aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/lxc-host/tasks/networkd.yml
diff options
context:
space:
mode:
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