EvoBSD/roles/post-install/tasks/motd.yml
Jérémy Dubois a26d6e13cb
Some checks failed
continuous-integration/drone/push Build is failing
yamllint line-lenght and empty-line
2020-10-23 10:15:57 +02:00

26 lines
712 B
YAML

---
- 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'
- name: Fetch root crontab content
command: >
'grep "/bin/sh /usr/share/scripts/motd-carp-state.sh" /var/cron/tabs/root'
check_mode: false
register: root_crontab_content
failed_when: false
changed_when: false
- 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
when:
- not (root_crontab_content.stdout
| regex_search('/bin/sh /usr/share/scripts/motd-carp-state.sh'))