Add exim role to base playbook
We want email to work. Add a default value so that integration tests work - and update the template so that if the value in the alias mapping is empty we don't write out a half-formed alias. Enable the epel repo on CentOS nodes in base-repos. This is done in install_puppet.sh, but install_puppet.sh doesn't get run on ansible-only nodes. Change-Id: I68ad9f66c3b8672d9642c7764e50adac9cafdaf9
This commit is contained in:
parent
67b77279f5
commit
a4a134815c
@ -8,3 +8,6 @@
|
|||||||
- hosts: "!disabled"
|
- hosts: "!disabled"
|
||||||
roles:
|
roles:
|
||||||
- base-server
|
- base-server
|
||||||
|
- role: exim
|
||||||
|
aliases:
|
||||||
|
root: "{{ ','.join(sysadmins|default([])) }}"
|
||||||
|
21
playbooks/roles/base-repos/tasks/CentOS.yaml
Normal file
21
playbooks/roles/base-repos/tasks/CentOS.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
- name: Install epel-release
|
||||||
|
yum:
|
||||||
|
name: epel-release
|
||||||
|
|
||||||
|
# there is a bug (rhbz#1261747) where systemd can fail to enable
|
||||||
|
# services due to selinux errors after upgrade. A work-around is
|
||||||
|
# to install the latest version of selinux and systemd here and
|
||||||
|
# restart the daemon for good measure after it is upgraded.
|
||||||
|
- name: Install latest selinux-policy and systemd
|
||||||
|
yum:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: latest
|
||||||
|
loop:
|
||||||
|
- selinux-policy
|
||||||
|
- systemd
|
||||||
|
register: systemd_updated
|
||||||
|
|
||||||
|
- name: Restart systemd
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
when: systemd_updated|changed
|
@ -3,3 +3,8 @@
|
|||||||
name: postfix
|
name: postfix
|
||||||
enabled: false
|
enabled: false
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
||||||
|
- name: Install exim
|
||||||
|
yum:
|
||||||
|
name: "{{ package }}"
|
||||||
|
enablerepo: epel
|
||||||
|
4
playbooks/roles/exim/tasks/default.yaml
Normal file
4
playbooks/roles/exim/tasks/default.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
- name: Install Exim
|
||||||
|
package:
|
||||||
|
state: present
|
||||||
|
name: '{{ package }}'
|
@ -14,11 +14,6 @@
|
|||||||
skip: true
|
skip: true
|
||||||
loop: "{{ query('first_found', params) }}"
|
loop: "{{ query('first_found', params) }}"
|
||||||
|
|
||||||
- name: Install Exim
|
|
||||||
package:
|
|
||||||
state: present
|
|
||||||
name: '{{ package }}'
|
|
||||||
|
|
||||||
- name: Write Exim defaults file
|
- name: Write Exim defaults file
|
||||||
template:
|
template:
|
||||||
src: "{{ sysdefault_template }}"
|
src: "{{ sysdefault_template }}"
|
||||||
|
@ -13,5 +13,7 @@ noc: root
|
|||||||
security: root
|
security: root
|
||||||
|
|
||||||
{% for k, v in aliases|dictsort %}
|
{% for k, v in aliases|dictsort %}
|
||||||
|
{% if v %}
|
||||||
{{ k }}: {{ v }}
|
{{ k }}: {{ v }}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user