From fa6e6b9a75caa95b0d536f4c91360bb29538498b Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Wed, 2 Nov 2022 11:51:16 +1300 Subject: [PATCH] Added loop_control construct --- tasks/communication.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/communication.yml b/tasks/communication.yml index 132cc97..cf3d85f 100644 --- a/tasks/communication.yml +++ b/tasks/communication.yml @@ -3,9 +3,9 @@ block: - name: postfix | Apply postfix configuration lineinfile: - dest: "{{ item.dest }}" - regexp: "{{ item.regexp }}" - line: "{{ item.line }}" + dest: "{{ configurations.dest }}" + regexp: "{{ configurations.regexp }}" + line: "{{ configurations.line }}" insertafter: EOF notify: Restart Postfix when: "'SMTP0' not in inventory_hostname" @@ -30,6 +30,8 @@ regexp: "^.?smtp_randomize_addresses =", line: "smtp_randomize_addresses = no", } + loop_control: + loop_var: configurations - name: postfix | Ensure Postfix is Started/Enabled service: