From 7ac910bd3ea43042158d3d9af8bac5e9b8d66c1e Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Fri, 23 Apr 2021 11:02:25 -0400 Subject: [PATCH] add option to skip routing config --- roles/lxd_host/tasks/lxd_host.yml | 3 +++ roles/lxd_host/tasks/main.yml | 1 + 2 files changed, 4 insertions(+) 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