ifupdown2: notify ifup -a + auto instead of allow-hotplug

This commit is contained in:
jeltz 2022-08-27 04:46:16 +02:00
parent 1281a6a51a
commit f723c3e1a4
Signed by: jeltz
GPG key ID: 800882B66C0C3326
3 changed files with 5 additions and 1 deletions

View file

@ -3,4 +3,7 @@
systemd:
name: networking.service
state: restarted
- name: Bring all interfaces up
shell: /usr/sbin/ifup -a
...

View file

@ -32,6 +32,7 @@
mode: u=rw,g=r,o=
notify:
- Restart networking
- Bring all interfaces up
- name: Enable and start networking
systemd:

View file

@ -1,7 +1,7 @@
{{ ansible_managed | comment }}
{% for name, iface in ifupdown2__interfaces.items() %}
allow-hotplug {{ name }}
auto {{ name }}
iface {{ name }}
{% for address in iface.addresses %}
address {{ address | ipaddr }}