2017-10-27 16:15:10 +00:00
|
|
|
- name: Turn off ISP nameservers
|
2018-10-08 23:00:25 +00:00
|
|
|
lineinfile:
|
|
|
|
state: present
|
|
|
|
backrefs: yes
|
|
|
|
regexp: '^PEERDNS'
|
|
|
|
line: 'PEERDNS="no"'
|
|
|
|
dest: "{{ has_ifcfg_gw }}"
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
- name: Turn on local nameserver
|
2018-10-08 23:00:25 +00:00
|
|
|
lineinfile:
|
|
|
|
state: present
|
|
|
|
line: 'DNS1="127.0.0.1"'
|
|
|
|
dest: "{{ has_ifcfg_gw }}"
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
- name: Remove the UUID
|
2018-10-08 23:00:25 +00:00
|
|
|
lineinfile:
|
|
|
|
state: absent
|
|
|
|
regexp: '^UUID'
|
|
|
|
dest: "{{ has_ifcfg_gw }}"
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
# Leave wifi as is NAME=<AP> needs to match keyring name.
|
|
|
|
- name: Fix the NM name
|
2018-10-08 23:00:25 +00:00
|
|
|
lineinfile:
|
|
|
|
state: present
|
|
|
|
backrefs: yes
|
|
|
|
regexp: '^NAME'
|
|
|
|
line: 'NAME="iiab-WAN"'
|
|
|
|
dest: "{{ has_ifcfg_gw }}"
|
2017-05-27 18:09:50 +00:00
|
|
|
when: has_wifi_gw == "none"
|
|
|
|
|
|
|
|
# testpoint - quoting and present
|
|
|
|
# note DEVICE can change what is displayed via "ip and friends"
|
|
|
|
- name: Fix the DEVICE
|
2018-10-08 23:00:25 +00:00
|
|
|
lineinfile:
|
|
|
|
state: present
|
|
|
|
backrefs: yes
|
|
|
|
regexp: '^DEVICE'
|
|
|
|
line: 'DEVICE="{{ iiab_wan_iface }}"'
|
|
|
|
dest: "{{ has_ifcfg_gw }}"
|
2017-06-09 23:25:56 +00:00
|
|
|
when: iiab_wan_iface != "none" and has_wifi_gw == "none"
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-10-27 16:15:10 +00:00
|
|
|
- name: Add marker
|
2018-10-08 23:00:25 +00:00
|
|
|
lineinfile:
|
|
|
|
state: present
|
|
|
|
line: "# Modified by IIAB"
|
|
|
|
dest: "{{ has_ifcfg_gw }}"
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
- name: Rename supplied gateway ifcfg file to WAN if present
|
|
|
|
shell: mv "{{ has_ifcfg_gw }}" /etc/sysconfig/network-scripts/ifcfg-WAN
|
|
|
|
when: has_wifi_gw == "none"
|
|
|
|
|
|
|
|
- name: Now setting ifcfg-WAN True after moving file
|
|
|
|
set_fact:
|
|
|
|
has_WAN: True
|
|
|
|
when: has_wifi_gw == "none"
|