diff --git a/roles/lxd_host/tasks/lxd_host.yml b/roles/lxd_host/tasks/lxd_host.yml index 1bed855..b50c80e 100644 --- a/roles/lxd_host/tasks/lxd_host.yml +++ b/roles/lxd_host/tasks/lxd_host.yml @@ -21,6 +21,7 @@ apt: name: [iptables, iptables-persistent] state: present + when: do_routing - name: add DNAT rules for containers tags: routing @@ -36,6 +37,7 @@ to_destination: "{{ hostvars[item]['internal_ip'] }}" become: yes with_items: "{{ groups['containers'] }}" + when: do_routing - name: save DNAT rules on lxd host tags: routing @@ -44,6 +46,7 @@ table: nat state: saved path: /etc/iptables/rules.v4 + when: do_routing # TODO: add other dnat ports in above loop? #- name: add dokuwiki DNAT routing diff --git a/roles/lxd_host/tasks/main.yml b/roles/lxd_host/tasks/main.yml index 42ade99..fabc52b 100644 --- a/roles/lxd_host/tasks/main.yml +++ b/roles/lxd_host/tasks/main.yml @@ -9,4 +9,5 @@ tmp_pubkey: /tmp/controller_key_rsa.pub host_iface: enp2s0 host_cidr: '192.168.11.0/24' + do_routing: false