From 7557ef6514673feeeae33a20b3b9be4fdedb3fb3 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Thu, 29 Jul 2021 05:49:36 -0400 Subject: [PATCH] make source CIDR optional for host NAT --- roles/lxd_host/tasks/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/lxd_host/tasks/main.yml b/roles/lxd_host/tasks/main.yml index 5854337..057865b 100644 --- a/roles/lxd_host/tasks/main.yml +++ b/roles/lxd_host/tasks/main.yml @@ -7,8 +7,6 @@ lxd_subnet_pfx: 10.98.46 lxd_bridge: lxdbr0 tmp_pubkey: /tmp/controller_key_rsa.pub - host_iface: enp2s0 - host_cidr: '192.168.11.0/24' block: # TODO: use template for lxd-init --preseed - name: copy ssh pubkey from controller to lxd host @@ -42,7 +40,7 @@ in_interface: "{{ host_iface }}" protocol: tcp match: tcp - source: "{{ host_cidr }}" + source: "{{ (host_ipt_ssh_cidr is defined) | ternary(host_ipt_ssh_cidr, '0.0.0.0') }}" jump: DNAT destination_port: "{{ hostvars[item]['ansible_port'] }}" to_destination: "{{ hostvars[item]['internal_ip'] }}"