From 9bd2c8c17a22c84da9a6ba6407c5b928d77fb469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Tue, 7 Dec 2021 15:41:02 +0000 Subject: roles/vmm: Serve autoinstall configurations via httpd --- roles/vmm/tasks/network.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 roles/vmm/tasks/network.yml (limited to 'roles/vmm/tasks/network.yml') diff --git a/roles/vmm/tasks/network.yml b/roles/vmm/tasks/network.yml new file mode 100644 index 0000000..b8fc7e1 --- /dev/null +++ b/roles/vmm/tasks/network.yml @@ -0,0 +1,27 @@ +- name: start ip forwarding + command: sysctl net.inet.ip{{ item }}.forwarding=1 + loop: "{{ vmm_network_forwarded_ips }}" + +- name: enable ip forwarding + lineinfile: + path: /etc/sysctl.conf + regexp: "^net.inet.ip{{ item }}.forwarding=" + line: "net.inet.ip{{ item }}.forwarding=1" + owner: 0 + group: 0 + mode: 0640 + create: true + loop: "{{ vmm_network_forwarded_ips }}" + +- name: create network switch + lineinfile: + path: "/etc/hostname.{{ vmm_network_switch.interface }}" + regexp: &network_line "add {{ ansible_default_ipv4.interface }}" + line: *network_line + owner: 0 + group: 0 + mode: 0640 + create: true + +- name: start network switch + command: "sh /etc/netstart {{ vmm_network_switch.interface }}" -- cgit v1.2.3