From 112fe1e195fadc4cd446ea881687caedf703e7fc Mon Sep 17 00:00:00 2001 From: x p k Date: Thu, 21 Jan 2021 11:51:10 +0800 Subject: [PATCH] UPD: run one change for each task --- idrac/idrac-dns.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 idrac/idrac-dns.yml diff --git a/idrac/idrac-dns.yml b/idrac/idrac-dns.yml new file mode 100644 index 0000000..54dd080 --- /dev/null +++ b/idrac/idrac-dns.yml @@ -0,0 +1,36 @@ +--- +- hosts: all + become: false + gather_facts: false + tasks: + + - name: Update drac DNS1 + raw: set iDRAC.IPv4.DNS1 72.3.128.240 + register: dns1Result + changed_when: + - '"modified successfully" in dns1Result.stdout' + + - name: Update drac DNS2 + raw: set iDRAC.IPv4.DNS2 72.3.128.241 + register: dns2Result + changed_when: + - '"modified successfully" in dns2Result.stdout' + + - name: Check changes + raw: | + get iDRAC.IPv4.DNS2 + register: checkOutput + + - name: Show check output + debug: + var: checkOutput.stdout_lines + + - name: Check changes + raw: | + get iDRAC.IPv4.DNS1 + register: checkOutput1 + + - name: Show check output1 + debug: + var: checkOutput1.stdout_lines +