[PATCH] Update postfix on jenkins master to not use bastion as a relay

Pierre-Yves Chibon pingou at pingoured.fr
Wed Oct 23 09:13:16 UTC 2013


Bastion is not accessible internally for the cloud instances which
thus cannot use it as relay to send emails. This change uses sed to
change the postfix configuration and tell postfix to not use bastion
as relay.
---

This concerns jenkins master which is not in freeze but since it touches postfix
I prefer to have approval for this change before pushing it.

I made the change by hand to clean the mail queue on jenkins master (and then
reverted it), so it works.
I tried to telnet to the host but port 25 is closed, as it should be, so there are
little chances it transforms this machine onto a spam box, but again, I'd rather be
on the safe side :)


Thanks,
Pierre


 playbooks/groups/jenkins-cloud.yml |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/playbooks/groups/jenkins-cloud.yml b/playbooks/groups/jenkins-cloud.yml
index 31da1c0..8079c4a 100644
--- a/playbooks/groups/jenkins-cloud.yml
+++ b/playbooks/groups/jenkins-cloud.yml
@@ -128,6 +128,11 @@
     notify: 
       - restart jenkins
 
+  # Postfix cannot use relay as it cannot connect to bastion
+  - name: Update postfix to send directly rather than via bastion
+    shell: sed -i -e 's|relayhost =  bastion|#relayhost =  bastion|' /etc/postfix/main.cf
+    notify:
+      - restart postfix
 
   handlers:
   - include: $handlers/restart_services.yml
-- 
1.7.2.1



More information about the infrastructure mailing list