From e15d9acbd07c1ecb6e6c6b24f547b60f7d92ebaf Mon Sep 17 00:00:00 2001 From: binary Date: Sun, 8 Nov 2020 20:56:18 +0100 Subject: Add working script for ssh init on alpine vm --- roles/vmm/tasks/generate_vmconf.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'roles/vmm/tasks/generate_vmconf.yml') diff --git a/roles/vmm/tasks/generate_vmconf.yml b/roles/vmm/tasks/generate_vmconf.yml index c4e80d8..e8f8245 100644 --- a/roles/vmm/tasks/generate_vmconf.yml +++ b/roles/vmm/tasks/generate_vmconf.yml @@ -4,13 +4,26 @@ --- +- name: Start ip forwarding + shell: sysctl net.inet.ip{{ item }}.forwarding=1 + loop: + - "" + - "6" + +- name: Enable ip forwarding + lineinfile: + path: /etc/sysctl.conf + regexp: "^net.inet.ip{{ item }}.forwarding=" + line: "net.inet.ip{{ item }}.forwarding=1" + loop: + - "" + - "6" + - name: Create network switch - template: - src: templates/hostname.j2 - dest: "/etc/hostname.{{ vmm.switch.interface }}" + shell: echo "add {{ hypervisor.interface }}" > /etc/hostname.{{ vmm.switch.iface }} - name: Start network switch - shell: "sh /etc/netstart {{ vmm.switch.interface }}" + shell: "sh /etc/netstart {{ vmm.switch.iface }}" - name: Generate vmm configuration template: -- cgit v1.2.3