khuedoan-homelab/metal/roles/tfstate/tasks/main.yml

30 lines
683 B
YAML
Raw Normal View History

- name: Create a tfstate container
# TODO use var for lxd host
run_once: true
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
# 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
- name: Install etcd
run_once: true
command: lxc exec tfstate -- apt-get install -y etcd