2017-05-27 18:09:50 +00:00
|
|
|
# supply an ifcfg if no gateway detected but wan_ip is set
|
|
|
|
# set user_wan_iface: <device> and use wan_* for static info
|
|
|
|
- name: Supply wan interface file
|
|
|
|
template: src=network/ifcfg-WAN.j2
|
|
|
|
dest=/etc/sysconfig/network-scripts/ifcfg-WAN
|
|
|
|
|
|
|
|
- include: NM.yml
|
|
|
|
when: 'ansible_distribution_version <= "20" and wan_ip != "dhcp"'
|
|
|
|
|
|
|
|
- name: Re-read network config files
|
|
|
|
shell: 'nmcli con reload'
|
|
|
|
ignore_errors: yes
|
|
|
|
when: 'ansible_distribution_version >= "21" and wan_ip != "dhcp"'
|
|
|
|
|
|
|
|
- name: use upstream nameserver until named is installed
|
|
|
|
lineinfile: dest=/etc/resolv.conf
|
2017-10-20 04:36:10 +00:00
|
|
|
line='nameserver {{ wan_nameserver }}'
|
2017-05-27 18:09:50 +00:00
|
|
|
create=yes
|
|
|
|
state=present
|