--- - name: main lxd_host block vars: img_server: https://images.linuxcontainers.org alp_img_alias: alpine/3.15/amd64 lxc_cmd: /snap/bin/lxc lxd_subnet_pfx: 10.98.46 lxd_bridge: lxdbr0 tmp_pubkey: /tmp/controller_key_rsa.pub block: # TODO: use template for lxd-init --preseed - name: copy ssh pubkey from controller to lxd host copy: src: "{{ lookup('env', 'HOME') + '/.ssh/id_rsa.pub' }}" dest: "{{ tmp_pubkey }}" # TODO: might make sense to add a cache redirect for alpine packages - include_tasks: tasks/container_install.yml tags: container_install vars: container_name: "{{ item }}" container_sshd_port: "{{ hostvars[item]['ansible_port'] }}" container_ip: "{{ hostvars[item]['internal_ip'] }}" tmp_sshd_config: "/tmp/sshd_config_{{ item }}" with_items: "{{ groups['containers'] }}" - name: iptables DNAT routing tasks include_tasks: routing.yml when: "'routing' in ansible_run_tags" tags: routing