Configure /etc/network/interfaces and /etc/resolv.conf using Ansible #98
3 changed files with 5 additions and 1 deletions
|
@ -3,4 +3,7 @@
|
||||||
systemd:
|
systemd:
|
||||||
name: networking.service
|
name: networking.service
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
|
- name: Bring all interfaces up
|
||||||
|
shell: /usr/sbin/ifup -a
|
||||||
...
|
...
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
mode: u=rw,g=r,o=
|
mode: u=rw,g=r,o=
|
||||||
notify:
|
notify:
|
||||||
- Restart networking
|
- Restart networking
|
||||||
|
- Bring all interfaces up
|
||||||
|
|
||||||
- name: Enable and start networking
|
- name: Enable and start networking
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
{% for name, iface in ifupdown2__interfaces.items() %}
|
{% for name, iface in ifupdown2__interfaces.items() %}
|
||||||
allow-hotplug {{ name }}
|
auto {{ name }}
|
||||||
iface {{ name }}
|
iface {{ name }}
|
||||||
{% for address in iface.addresses %}
|
{% for address in iface.addresses %}
|
||||||
address {{ address | ipaddr }}
|
address {{ address | ipaddr }}
|
||||||
|
|
Loading…
Reference in a new issue