2020-08-25 17:57:22 +02:00
|
|
|
---
|
|
|
|
- name: Deploy dynamic motd script for CARP master or backup
|
|
|
|
copy:
|
|
|
|
src: motd-carp-state.sh
|
|
|
|
dest: /usr/share/scripts/motd-carp-state.sh
|
|
|
|
owner: root
|
|
|
|
group: wheel
|
|
|
|
mode: '0755'
|
|
|
|
|
2020-10-14 17:19:27 +02:00
|
|
|
- name: Fetch root crontab content
|
2020-10-23 10:15:57 +02:00
|
|
|
command: >
|
2020-10-26 16:39:43 +01:00
|
|
|
grep "/bin/sh /usr/share/scripts/motd-carp-state.sh" /var/cron/tabs/root
|
2020-10-14 17:19:27 +02:00
|
|
|
check_mode: false
|
|
|
|
register: root_crontab_content
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
|
2020-08-25 17:57:22 +02:00
|
|
|
- name: Cron job for dynamic motd script is installed
|
|
|
|
cron:
|
|
|
|
name: dynamic motd for CARP
|
|
|
|
job: "/bin/sh /usr/share/scripts/motd-carp-state.sh"
|
|
|
|
disabled: true
|
2020-10-14 17:19:27 +02:00
|
|
|
when:
|
2020-10-23 10:15:57 +02:00
|
|
|
- not (root_crontab_content.stdout
|
|
|
|
| regex_search('/bin/sh /usr/share/scripts/motd-carp-state.sh'))
|