Commit be4eea75 authored by Joanne Hugé's avatar Joanne Hugé

playbook/ors: use systemd-networkd instead of ifupdown

parent a484c07d
auto lo
iface lo inet loopback
auto enp2s0
iface enp2s0 inet dhcp
post-up echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
post-up iptables -t nat -A POSTROUTING -o enp2s0 -j MASQUERADE
post-up iptables -t nat -A POSTROUTING -p udp -m udp --sport 5353 -j SNAT --to-source :53
post-up iptables -t nat -A PREROUTING -p udp -m udp --dport 53 -j DNAT --to-destination :5353
post-up ip6tables -t nat -A POSTROUTING -o enp2s0 -j MASQUERADE
auto enp0s31f6
iface enp0s31f6 inet dhcp
post-up echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
post-up iptables -t nat -A POSTROUTING -o enp0s31f6 -j MASQUERADE
post-up iptables -t nat -A POSTROUTING -p udp -m udp --sport 5353 -j SNAT --to-source :53
post-up iptables -t nat -A PREROUTING -p udp -m udp --dport 53 -j DNAT --to-destination :5353
post-up ip6tables -t nat -A POSTROUTING -o enp0s31f6 -j MASQUERADE
source /etc/network/interfaces.d/*
[Match]
Name=en*
[Network]
DHCP=yes
[Service]
ExecStart=
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any
......@@ -4,3 +4,4 @@ dependencies:
- { role: package, package_name: patchelf, package_state: present }
- { role: package, package_name: util-linux, package_state: present }
- { role: package, package_name: grub-efi-amd64-signed, package_state: present }
- { role: package, package_name: ifupdown, package_state: absent }
......@@ -95,8 +95,17 @@
# Network
- name: Configure /etc/network/interfaces
copy: src=interfaces dest=/etc/network/interfaces owner=root mode=644
- name: Configure /etc/systemd/network/dhcp.network
copy: src=systemd-dhcp-network dest=/etc/systemd/network/dhcp.network owner=root mode=644
- name: Create a directory if it does not exist
file: path=/etc/systemd/system/systemd-networkd-wait-online.service.d state=directory mode=0755
- name: Configure /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
copy: src=systemd-wait-online-override dest=/etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf owner=root mode=644
- name: Enable and start systemd-networkd
systemd: name=systemd-networkd.service enabled=yes state=started
- name: Configure dhcp timeout
lineinfile: dest=/etc/dhcp/dhclient.conf regexp="^timeout (.*)" line="timeout 15" state=present
......
55ce33d3e89f0093de552d8de66e306b6c142c06a4aa3e36e03954785f720047 -
6f816c3e09af4f17f266a55b1e0a91c844110239bb877e60a6d5087b7ce5fd73 -
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment