Jérémy Lecour
ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2777|524|2253|2462|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Fully Qualified Collection Name
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
---
|
|
|
|
- name: python-requests is installed (check_rabbitmq dependency)
|
|
ansible.builtin.apt:
|
|
name: python-requests
|
|
state: present
|
|
when: ansible_python_version is version('3', '<')
|
|
|
|
- name: python3-requests is installed (check_rabbitmq dependency)
|
|
ansible.builtin.apt:
|
|
name: python3-requests
|
|
state: present
|
|
when: ansible_python_version is version('3', '>=')
|
|
|
|
- ansible.builtin.include_role:
|
|
name: evolix/remount-usr
|
|
|
|
# https://raw.githubusercontent.com/CaptPhunkosis/check_rabbitmq/master/check_rabbitmq
|
|
- name: check_rabbitmq is installed
|
|
ansible.builtin.copy:
|
|
src: check_rabbitmq
|
|
dest: /usr/local/lib/nagios/plugins/check_rabbitmq
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
force: yes
|
|
when: ansible_distribution_major_version is version('11', '<=')
|
|
|
|
- name: check_rabbitmq (Python 3 version) is installed
|
|
ansible.builtin.copy:
|
|
src: check_rabbitmq.python3
|
|
dest: /usr/local/lib/nagios/plugins/check_rabbitmq
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
force: yes
|
|
when: ansible_distribution_major_version is version('11', '>=')
|
|
|
|
- name: check_rabbitmq is available for NRPE
|
|
ansible.builtin.lineinfile:
|
|
dest: /etc/nagios/nrpe.d/evolix.cfg
|
|
regexp: 'command\[check_rab_connection_count\]'
|
|
line: 'command[check_rab_connection_count]=sudo /usr/local/lib/nagios/plugins/check_rabbitmq -a connection_count -C {{ rabbitmq_connections_critical }} -W {{ rabbitmq_connections_warning }}'
|
|
notify: restart nagios-nrpe-server
|
|
|
|
- name: sudo without password for nagios
|
|
ansible.builtin.lineinfile:
|
|
dest: /etc/sudoers.d/evolinux
|
|
regexp: 'check_rabbitmq'
|
|
line: 'nagios ALL = NOPASSWD: /usr/local/lib/nagios/plugins/check_rabbitmq'
|
|
insertafter: '^nagios'
|
|
validate: "visudo -cf %s"
|