From 754af4bdeaeb795739dbfdeffd9dbc8180ddf5b5 Mon Sep 17 00:00:00 2001 From: rubenb Date: Mon, 16 Oct 2023 09:51:12 +0200 Subject: [PATCH] exim4 test --- .../roles/base-config-debian-os/handlers/main.yaml | 8 +++----- .../roles/base-config-debian-os/tasks/main.yaml | 10 +++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/linux/base-config-debian/roles/base-config-debian-os/handlers/main.yaml b/linux/base-config-debian/roles/base-config-debian-os/handlers/main.yaml index 80b8eb3..ead4f54 100644 --- a/linux/base-config-debian/roles/base-config-debian-os/handlers/main.yaml +++ b/linux/base-config-debian/roles/base-config-debian-os/handlers/main.yaml @@ -1,5 +1,3 @@ -# restart exim4 service to apply changes -- name: Restart exim4 service - service: - name: exim4 - state: restarted \ No newline at end of file +# apply reconfig and restart exim4 service to apply changes +- name: apply reconfig + command: sudo dpkg-reconfigure -f noninteractive exim4-config \ No newline at end of file diff --git a/linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml b/linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml index cc42f2d..4915d94 100644 --- a/linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml +++ b/linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml @@ -74,7 +74,15 @@ value: "{{ ansible_nodename }}" # var to define survey(encuesta) - name: exim4/use_split_config value: 'false' - notify: Restart exim4 service + notify: apply reconfig + register: exim4_conf + +# Restart after reconfigure +- name: restart exim4 service + service: + name: exim4 + state: restarted + when: exim4_conf.changed # Send mail to verify relay-host #- name: sending mail to verify exim4 config works