2020-03-08 15:41:55 +00:00
|
|
|
|
---
|
|
|
|
|
# Server/Cronmails: Setup Mails from Cronjobs (install exim) - CentOS Version
|
|
|
|
|
|
|
|
|
|
# Install exim
|
|
|
|
|
- name: cronmails - Install exim4 as MTA
|
|
|
|
|
become: yes
|
2021-08-28 14:50:37 +00:00
|
|
|
|
ansible.builtin.yum:
|
2020-03-08 15:41:55 +00:00
|
|
|
|
name: "{{ packages }}"
|
|
|
|
|
state: present
|
|
|
|
|
vars:
|
|
|
|
|
packages:
|
2020-03-08 16:56:50 +00:00
|
|
|
|
- exim
|
|
|
|
|
|
|
|
|
|
# Configure exim
|
|
|
|
|
- name: cronmails - Create exim config folder
|
|
|
|
|
become: yes
|
2021-08-28 14:50:37 +00:00
|
|
|
|
ansible.builtin.file:
|
2020-03-08 16:56:50 +00:00
|
|
|
|
path: /etc/exim
|
|
|
|
|
state: directory
|
|
|
|
|
# TODO: exim config works quite differently on CentOS compared to Debian!!!
|
|
|
|
|
# # - name: cronmails - Copy exim config template
|
|
|
|
|
# # become: yes
|
2021-08-28 14:50:37 +00:00
|
|
|
|
# # ansible.builtin.copy:
|
2020-03-08 16:56:50 +00:00
|
|
|
|
# # src: "{{ role_path }}/files/exim4.conf.template"
|
|
|
|
|
# # dest: /etc/exim/exim.conf.template
|
|
|
|
|
# # register: cronmails_conftmp_update
|
|
|
|
|
# # - name: cronmails - Copy exim config file
|
|
|
|
|
# # become: yes
|
2021-08-28 14:50:37 +00:00
|
|
|
|
# # ansible.builtin.template:
|
2020-03-08 16:56:50 +00:00
|
|
|
|
# # src: "{{ role_path }}/templates/update-exim4.conf.conf"
|
|
|
|
|
# # dest: /etc/exim/update-exim.conf.conf
|
|
|
|
|
# # register: cronmails_conffile_update
|
|
|
|
|
# # - name: cronmails - Run update-exim.conf
|
2022-02-13 19:52:02 +00:00
|
|
|
|
# # when: cronmails_conftmp_update.changed or cronmails_conffile_update.changed
|
2020-03-08 16:56:50 +00:00
|
|
|
|
# # become: yes
|
2021-08-28 14:50:37 +00:00
|
|
|
|
# # ansible.builtin.shell: "update-exim.conf"
|
2020-03-08 16:56:50 +00:00
|
|
|
|
# - name: cronmails - Enable and start exim
|
|
|
|
|
# become: yes
|
2021-08-28 14:50:37 +00:00
|
|
|
|
# ansible.builtin.service:
|
2020-03-08 16:56:50 +00:00
|
|
|
|
# name: exim
|
|
|
|
|
# state: started
|
|
|
|
|
# enabled: yes
|