diff --git a/tasks/main.yml b/tasks/main.yml index dd56878..2de67b5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -70,12 +70,6 @@ tags: - networking -- name: ensure interfaces.d directory exists - file: - path: /etc/network/interfaces.d - state: directory - when: wanted_ip4 is defined or wanted_ip6 is defined - - name: configure watchdog template: src: watchdog.conf.j2 diff --git a/tasks/pkg_Alpine.yml b/tasks/pkg_Alpine.yml index 1cf5e7c..b7e6e9b 100644 --- a/tasks/pkg_Alpine.yml +++ b/tasks/pkg_Alpine.yml @@ -51,15 +51,6 @@ tags: - pkg -- name: install bridge (alpine) - apk: - name: - - bridge - state: present - when: bridged_network is defined - tags: - - pkg - - name: install ssmtp (alpine) apk: name: diff --git a/templates/networking.j2 b/templates/networking.j2 index f2dd825..afda18f 100644 --- a/templates/networking.j2 +++ b/templates/networking.j2 @@ -7,31 +7,19 @@ iface lo inet loopback # The main interface auto eth0 -{% if bridged_network is defined and bridged_network %} -auto br0 -iface br0 - requires eth0{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%} - bridge-ports eth0{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%} - bridge-fd 0 - bridge-stp off -{% else %} -iface eth0 -{% endif %} {% if wanted_ip4 is defined %} +iface eth0 inet static address {{ wanted_ip4 }}/24 gateway {{ local_network.gateway }} {% else %} - use dhcp +iface eth0 inet dhcp {% endif %} {% if wanted_ip6 is defined %} +iface eth0 inet6 static {% if local_network.gateway6 is defined %} address {{ wanted_ip6 }}/64 gateway {{ local_network.gateway6 }} - {% if bridged_network is defined and bridged_network %} - up echo 0 > /proc/sys/net/ipv6/conf/br0/accept_ra - {% else %} pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra - {% endif %} {% else %} address {{ wanted_ip6 }}/128 post-up ip addrlabel add prefix {{ wanted_ip6 }}/64 label 99