26 lines
767 B
YAML
26 lines
767 B
YAML
# ansible-playbook local_lxd/run_terraform.yml -v --become-password-file local_lxd/.sudo_pass
|
|
- hosts: localhost
|
|
gather_facts: false
|
|
become: true
|
|
roles:
|
|
#- role: lxd # ansible-galaxy collection install rjlasko.ansible
|
|
# vars:
|
|
# lxd:
|
|
# host: {}
|
|
tasks:
|
|
- community.general.terraform: project_path="terraform" force_init=true
|
|
register: terraform
|
|
|
|
- name: Add LXD instance to group 'lxd_instances'
|
|
ansible.builtin.add_host:
|
|
name: "{{terraform.outputs.container_name}}"
|
|
groups: lxd_instances
|
|
ansible_lxd_remote: "localhost"
|
|
plugin: community.general.lxd
|
|
|
|
- hosts: lxd_instances
|
|
gather_facts: false
|
|
tasks:
|
|
- ansible.builtin.ping: {}
|
|
#- ansible.builtin.include_role: name=sudo
|