aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/generate_vmconf.yml
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-11-08 20:56:18 +0100
committerbinary <me@rgoncalves.se>2020-11-08 20:56:18 +0100
commite15d9acbd07c1ecb6e6c6b24f547b60f7d92ebaf (patch)
treeef0130c97f594ca7d57676c9e1d027724211fba8 /roles/vmm/tasks/generate_vmconf.yml
parent605d9efb0ad2734278d8bdb5f9e0862d8e0a1a7e (diff)
downloadinfrastructure-e15d9acbd07c1ecb6e6c6b24f547b60f7d92ebaf.tar.gz
Add working script for ssh init on alpine vm
Diffstat (limited to 'roles/vmm/tasks/generate_vmconf.yml')
-rw-r--r--roles/vmm/tasks/generate_vmconf.yml21
1 files changed, 17 insertions, 4 deletions
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:
remember that computers suck.