Jérémy Lecour
00fe225a3c
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2615|7|2608|177|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/278//ansiblelint">Evolix » ansible-roles » unstable #278</a>
gitea/ansible-roles/pipeline/head This commit looks good
62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
---
|
|
|
|
- name: install Keepalived service
|
|
ansible.builtin.apt:
|
|
pkg: keepalived
|
|
state: present
|
|
tags:
|
|
- keepalived
|
|
|
|
- name: Add notify.sh script for NRPE check
|
|
ansible.builtin.file:
|
|
src: notify.sh
|
|
dest: /etc/keepalived/notify.sh
|
|
mode: "0755"
|
|
owner: root
|
|
group: root
|
|
force: true
|
|
notify: restart keepalived
|
|
tags:
|
|
- keepalived
|
|
- nrpe
|
|
|
|
- name: check_keepalived is installed
|
|
ansible.builtin.file:
|
|
src: check_keepalived
|
|
dest: /usr/local/lib/nagios/plugins/check_keepalived
|
|
mode: "0755"
|
|
owner: root
|
|
group: root
|
|
force: true
|
|
tags:
|
|
- keepalived
|
|
- nrpe
|
|
|
|
- name: Use check_keepalived for NRPE
|
|
ansible.builtin.lineinfile:
|
|
dest: /etc/nagios/nrpe.d/evolix.cfg
|
|
regexp: 'command\[check_keepalived\]'
|
|
replace: 'command[check_keepalived]=/usr/local/lib/nagios/plugins/check_keepalived'
|
|
notify: restart nagios-nrpe-server
|
|
tags:
|
|
- keepalived
|
|
- nrpe
|
|
|
|
- name: generate Keepalived configuration
|
|
ansible.builtin.template:
|
|
src: keepalived.conf.j2
|
|
dest: /etc/keepalived/keepalived.conf
|
|
mode: "0644"
|
|
notify: restart keepalived
|
|
tags:
|
|
- keepalived
|
|
|
|
- name: enable and restart Keepalived service
|
|
ansible.builtin.systemd:
|
|
name: keepalived
|
|
daemon_reload: yes
|
|
state: started
|
|
enabled: yes
|
|
tags:
|
|
- keepalived
|