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
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
---
|
|
|
|
- name: Is nrpe present ?
|
|
ansible.builtin.stat:
|
|
path: /etc/nagios/nrpe.d/evolix.cfg
|
|
register: nrpe_evolix_config
|
|
|
|
- block:
|
|
- name: Install dependencies
|
|
ansible.builtin.apt:
|
|
name:
|
|
- libcache-memcached-perl
|
|
- libmemcached11
|
|
|
|
- ansible.builtin.include_role:
|
|
name: evolix/remount-usr
|
|
|
|
- name: Copy Nagios check for memcached
|
|
ansible.builtin.copy:
|
|
src: check_memcached.pl
|
|
dest: /usr/local/lib/nagios/plugins/
|
|
mode: "0755"
|
|
|
|
- name: install check_memcached_instances
|
|
ansible.builtin.copy:
|
|
src: check_memcached_instances.sh
|
|
dest: /usr/local/lib/nagios/plugins/check_memcached_instances
|
|
force: yes
|
|
mode: "0755"
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Add NRPE check (single instance)
|
|
ansible.builtin.lineinfile:
|
|
name: /etc/nagios/nrpe.d/evolix.cfg
|
|
regexp: '^command\[check_memcached\]='
|
|
line: 'command[check_memcached]=/usr/local/lib/nagios/plugins/check_memcached.pl -H 127.0.0.1 -p {{ memcached_port }}'
|
|
notify: restart nagios-nrpe-server
|
|
when: memcached_instance_name is undefined
|
|
|
|
- name: Add NRPE check (multi instance)
|
|
ansible.builtin.lineinfile:
|
|
name: /etc/nagios/nrpe.d/evolix.cfg
|
|
regexp: '^command\[check_memcached\]='
|
|
line: 'command[check_memcached]=/usr/local/lib/nagios/plugins/check_memcached_instances'
|
|
notify: restart nagios-nrpe-server
|
|
when: memcached_instance_name is defined
|
|
|
|
when: nrpe_evolix_config.stat.exists
|