aboutsummaryrefslogblamecommitdiffstats
path: root/roles/vmm/tasks/network.yml
blob: b8fc7e17ca4f0ce2d7abc3a045762f4752940b00 (plain) (tree)


























                                                                    
- 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 }}"
remember that computers suck.