From 30c4f2a86880a303cbb2ee186aa0563c760773af Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 8 Oct 2018 18:55:09 -0400 Subject: [PATCH] Update enable_wan.yml --- roles/network/tasks/enable_wan.yml | 44 ++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/roles/network/tasks/enable_wan.yml b/roles/network/tasks/enable_wan.yml index 5cbeac07c..5cdb44956 100644 --- a/roles/network/tasks/enable_wan.yml +++ b/roles/network/tasks/enable_wan.yml @@ -1,32 +1,36 @@ - name: Turn off ONBOOT for WAN on reboot if disabled - lineinfile: state=present - backrefs=yes - regexp='^ONBOOT' - line='ONBOOT="no"' - dest=/etc/sysconfig/network-scripts/ifcfg-WAN + lineinfile: + state: present + backrefs: yes + regexp: '^ONBOOT' + line: 'ONBOOT="no"' + dest: /etc/sysconfig/network-scripts/ifcfg-WAN when: has_WAN and iiab_wan_iface == "none" #testpoint Need to ensure we have only one entry - name: Ensure macaddress is correct - lineinfile: state=present - backrefs=yes - regexp='^HWADDR' - line='HWADDR="{{ hostvars[inventory_hostname]['ansible_' + iiab_wan_iface]['macaddress'] }}"' - dest=/etc/sysconfig/network-scripts/ifcfg-WAN + lineinfile: + state: present + backrefs: yes + regexp: '^HWADDR' + line: 'HWADDR="{{ hostvars[inventory_hostname]['ansible_' + iiab_wan_iface]['macaddress'] }}"' + dest: /etc/sysconfig/network-scripts/ifcfg-WAN when: has_WAN and iiab_wan_iface != "none" - name: Fix the DEVICE - lineinfile: state=present - backrefs=yes - regexp='^NAME' - line='NAME="iiab-WAN"' - dest=/etc/sysconfig/network-scripts/ifcfg-WAN + lineinfile: + state: present + backrefs: yes + regexp: '^NAME' + line: 'NAME="iiab-WAN"' + dest: /etc/sysconfig/network-scripts/ifcfg-WAN when: has_WAN and iiab_wan_iface != "none" - name: Turn on ONBOOT for WAN on reboot if enabled - lineinfile: state=present - backrefs=yes - regexp="^ONBOOT" - line="ONBOOT=yes" - dest=/etc/sysconfig/network-scripts/ifcfg-WAN + lineinfile: + state: present + backrefs: yes + regexp: "^ONBOOT" + line: "ONBOOT=yes" + dest: /etc/sysconfig/network-scripts/ifcfg-WAN when: has_WAN and iiab_wan_iface != "none"