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'] }}"