From aa1c8287d506ce57d87f3a538ffe86299af295b1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 8 Oct 2018 19:00:25 -0400 Subject: [PATCH] Update edit_ifcfg.yml --- roles/network/tasks/edit_ifcfg.yml | 54 +++++++++++++++++------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/roles/network/tasks/edit_ifcfg.yml b/roles/network/tasks/edit_ifcfg.yml index 90a1d368f..647d1a6f1 100644 --- a/roles/network/tasks/edit_ifcfg.yml +++ b/roles/network/tasks/edit_ifcfg.yml @@ -1,43 +1,49 @@ - name: Turn off ISP nameservers - lineinfile: state=present - backrefs=yes - regexp='^PEERDNS' - line='PEERDNS="no"' - dest={{ has_ifcfg_gw }} + lineinfile: + state: present + backrefs: yes + regexp: '^PEERDNS' + line: 'PEERDNS="no"' + dest: "{{ has_ifcfg_gw }}" - name: Turn on local nameserver - lineinfile: state=present - line='DNS1="127.0.0.1"' - dest={{ has_ifcfg_gw }} + lineinfile: + state: present + line: 'DNS1="127.0.0.1"' + dest: "{{ has_ifcfg_gw }}" - name: Remove the UUID - lineinfile: state=absent - regexp='^UUID' - dest={{ has_ifcfg_gw }} + lineinfile: + state: absent + regexp: '^UUID' + dest: "{{ has_ifcfg_gw }}" # Leave wifi as is NAME= needs to match keyring name. - name: Fix the NM name - lineinfile: state=present - backrefs=yes - regexp='^NAME' - line='NAME="iiab-WAN"' - dest={{ has_ifcfg_gw }} + lineinfile: + state: present + backrefs: yes + regexp: '^NAME' + line: 'NAME="iiab-WAN"' + dest: "{{ has_ifcfg_gw }}" when: has_wifi_gw == "none" # testpoint - quoting and present # note DEVICE can change what is displayed via "ip and friends" - name: Fix the DEVICE - lineinfile: state=present - backrefs=yes - regexp='^DEVICE' - line='DEVICE="{{ iiab_wan_iface }}"' - dest={{ has_ifcfg_gw }} + lineinfile: + state: present + backrefs: yes + regexp: '^DEVICE' + line: 'DEVICE="{{ iiab_wan_iface }}"' + dest: "{{ has_ifcfg_gw }}" when: iiab_wan_iface != "none" and has_wifi_gw == "none" - name: Add marker - lineinfile: state=present - line="# Modified by IIAB" - dest={{ has_ifcfg_gw }} + lineinfile: + state: present + line: "# Modified by IIAB" + dest: "{{ has_ifcfg_gw }}" - name: Rename supplied gateway ifcfg file to WAN if present shell: mv "{{ has_ifcfg_gw }}" /etc/sysconfig/network-scripts/ifcfg-WAN