diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2016-02-18 16:46:35 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-02-19 12:38:42 +0000 |
commit | 45c577eba10860e20114d3cbf5d0d9675d3bf188 (patch) | |
tree | 8c69f630304b9edb4ff0f3166328beaef2aac081 /baserock_mail | |
parent | 2ff5d6f4fb78cbdc0affdcb5a96cdc0c4612f743 (diff) | |
download | infrastructure-45c577eba10860e20114d3cbf5d0d9675d3bf188.tar.gz |
baserock_mail: Update on top of Fedora 23, redeploy
The instance-config.yml script was failing to create a valid EXIM config
against the default /etc/exim.conf in Fedora 23, this is fixed now. The
regexp configuration approach is rather fragile.
Change-Id: Id1b4e3a854cb579ee58c1c4f7674415c6e8c096a
Diffstat (limited to 'baserock_mail')
-rw-r--r-- | baserock_mail/image-config.yml | 22 | ||||
-rw-r--r-- | baserock_mail/instance-config.yml | 9 |
2 files changed, 25 insertions, 6 deletions
diff --git a/baserock_mail/image-config.yml b/baserock_mail/image-config.yml new file mode 100644 index 00000000..8d65b4f7 --- /dev/null +++ b/baserock_mail/image-config.yml @@ -0,0 +1,22 @@ +# System configuration for Baserock mail relay. +# +# This Ansible playbook expects to be run on a Fedora 23 Cloud image. +--- +- hosts: mail + gather_facts: false + sudo: yes + tasks: + # See: https://fedoramagazine.org/getting-ansible-working-fedora-23/ + - name: install Python2 and required deps for Ansible modules + raw: dnf install -y python2 python2-dnf libselinux-python + + - name: enable persistant journal + shell: mkdir /var/log/journal + args: + creates: /var/log/journal + + - name: ensure system up to date + dnf: name=* state=latest + + - name: exim4 installation + dnf: name=exim state=installed diff --git a/baserock_mail/instance-config.yml b/baserock_mail/instance-config.yml index f4cb4927..cd276df7 100644 --- a/baserock_mail/instance-config.yml +++ b/baserock_mail/instance-config.yml @@ -1,17 +1,14 @@ # Configuration for Baserock mail relay # -# This Ansible playbook expects to be run on a Fedora 21 Cloud image. +# This Ansible playbook expects to be run after the image-config.yml playbook. --- - hosts: mail gather_facts: false sudo: yes vars: - LOCAL_IP: 192.168.222.111 + LOCAL_IP: 192.168.222.145 PUBLIC_IP: 185.43.218.171 tasks: - - name: exim4 installation - yum: name=exim state=installed - # Fedora provides a default /etc/exim/exim.conf. Rather than copy it and # overwrite it, since we only need to make a few changes, I've used the # lineinfile module to do search-and-replace. It's a bit ugly though. It @@ -67,7 +64,7 @@ # For now, we just have the IP. - name: set primary hostname to public IP lineinfile: - regexp: '^#?primary_hostname = .*$' + regexp: '^#?\s+primary_hostname =.*$' line: 'primary_hostname = {{ PUBLIC_IP }}' dest: /etc/exim/exim.conf |