123456789101112131415161718192021222324252627282930313233343536 |
- ---
- - name: Install mailx and postfix
- package:
- name: "{{ mail_packages }}"
- state: present
- - name: Start postfix service
- systemd:
- name: postfix
- state: started
- - name: Fetch ansible-playbook path
- command: whereis ansible-playbook
- changed_when: false
- register: ansible_playbook_path
- - name: Schedule cron job for alerting
- cron:
- name: Auth failure alerting
- special_time: hourly
- job: "{{ ansible_playbook_path.stdout.split(' ')[1] }} {{ role_path }}/files/auth_failure_check.yml -e 'alert_email_address={{ alert_email_address }}'"
|