aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/lxc-host/tasks/networkd.yml
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-01-11 07:45:58 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-01-11 07:45:58 +0100
commit99ce768a7d6fe9e828caf932554c4e095c1d00b2 (patch)
treeb367f0776e0640714d6a581ba5eb0d4e2f3d1b76 /ansible/roles/lxc-host/tasks/networkd.yml
parentfca718acb8d31e3f05608fb5aedfa4c7d34c7455 (diff)
downloadinfra-99ce768a7d6fe9e828caf932554c4e095c1d00b2.tar.gz
infra-99ce768a7d6fe9e828caf932554c4e095c1d00b2.tar.bz2
infra-99ce768a7d6fe9e828caf932554c4e095c1d00b2.tar.xz
infra-99ce768a7d6fe9e828caf932554c4e095c1d00b2.zip
lxc-host: Moving to its own playbook. Adding arius-test1. Only
configuring ipv4/6 forwarding for the created interface. Adding configurable ipv6 address too. wireguard: Tagging old nets with never. nftables: Trying out portforwarding on arius.
Diffstat (limited to 'ansible/roles/lxc-host/tasks/networkd.yml')
-rw-r--r--ansible/roles/lxc-host/tasks/networkd.yml30
1 files changed, 10 insertions, 20 deletions
diff --git a/ansible/roles/lxc-host/tasks/networkd.yml b/ansible/roles/lxc-host/tasks/networkd.yml
index f7ae410..526fc29 100644
--- a/ansible/roles/lxc-host/tasks/networkd.yml
+++ b/ansible/roles/lxc-host/tasks/networkd.yml
@@ -10,32 +10,12 @@
- debug: var=br_if
- debug: var=internal_if
- - name: Configure sysctl, enable ipv4 and ipv6 forwarding
- sysctl:
- name: "{{ item }}"
- value: 1
- with_items:
- - net.ipv4.ip_forward
- - net.ipv6.conf.all.forwarding
-
- name: enable systemd-networkd
service:
name: systemd-networkd
enabled: yes
state: started
-# - name: "/etc/systemd/network/50-0-lxc-host-{{ lxc_host__hardware_if }}.network"
-# notify: systemctl restart systemd-networkd
-# copy:
-# dest: "/etc/systemd/network/50-0-lxc-host-{{ lxc_host__hardware_if }}.network"
-# content: |
-# [Match]
-# Name={{ lxc_host__hardware_if }}
-#
-# [Network]
-# Address={{ hardware_if.ipv4.address }}/{{ hardware_if.ipv4.netmask }}
-# Gateway={{ hardware_if.ipv4.gateway }}
-
- name: "{{ file_prefix }}-1-{{ lxc_host__internal_if }}.netdev"
notify: systemctl restart systemd-networkd
copy:
@@ -80,3 +60,13 @@
{% if internal_if.ipv6 is defined %}
Address={{ internal_if.ipv6.address }}/{{ internal_if.ipv6.netmask }}
{% endif %}
+
+ - meta: flush_handlers
+
+ - name: Configure sysctl, enable ipv4 and ipv6 forwarding for {{ br_if }}
+ sysctl:
+ name: "{{ item }}"
+ value: 1
+ with_items:
+ - net.ipv4.conf.{{ br_if }}.forwarding
+ - net.ipv6.conf.{{ br_if }}.forwarding