2021-04-24 18:02:19 +07:00
|
|
|
- name: Create a tfstate container
|
2021-04-24 19:07:41 +07:00
|
|
|
# TODO use var for lxd host
|
|
|
|
run_once: true
|
2021-04-24 18:02:19 +07:00
|
|
|
lxd_container:
|
|
|
|
name: tfstate
|
|
|
|
state: started
|
|
|
|
source:
|
|
|
|
type: image
|
|
|
|
mode: pull
|
|
|
|
server: https://images.linuxcontainers.org
|
|
|
|
alias: ubuntu/focal/amd64
|
|
|
|
wait_for_ipv4_addresses: yes
|
|
|
|
devices:
|
|
|
|
eth0:
|
|
|
|
type: nic
|
|
|
|
nictype: macvlan
|
|
|
|
parent: eno1
|
|
|
|
|
2021-04-24 19:07:41 +07:00
|
|
|
# TODO Use native lxd connection instead of exec
|
|
|
|
# - name: Add tfstate container to host list
|
|
|
|
# delegate_to: metal0
|
|
|
|
# add_host:
|
|
|
|
# name: tfstate
|
|
|
|
# groups: lxd
|
|
|
|
# ansible_connection: lxd
|
2021-04-24 18:02:19 +07:00
|
|
|
|
2021-04-24 19:07:41 +07:00
|
|
|
- name: Install etcd
|
|
|
|
run_once: true
|
|
|
|
command: lxc exec tfstate -- apt-get install -y etcd
|