ansible-role-server/tasks/cronmails-Centos.yml

43 lines
1.3 KiB
YAML
Raw Normal View History

---
# Server/Cronmails: Setup Mails from Cronjobs (install exim) - CentOS Version
# Install exim
- name: Cronmails - Install exim4 as MTA
become: true
ansible.builtin.yum:
name: "{{ packages }}"
state: present
vars:
packages:
2020-03-08 16:56:50 +00:00
- exim
# Configure exim
- name: Cronmails - Create exim config folder
become: true
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: true
# # 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: true
# # 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
# # when: cronmails_conftmp_update.changed or cronmails_conffile_update.changed
# # become: true
# # ansible.builtin.shell: "update-exim.conf"
# - name: Cronmails - Enable and start exim
# become: true
# ansible.builtin.service:
2020-03-08 16:56:50 +00:00
# name: exim
# state: started
# enabled: true