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

22 lines
512 B
YAML

- name: Install Python library for the Docker
dnf:
name: python-docker
- name: Create etcd container
docker_container:
name: etcd-tfstate
image: bitnami/etcd
restart_policy: always
env:
ALLOW_NONE_AUTHENTICATION: "yes"
published_ports:
- "{{ etcd_port }}:2379"
volumes:
- tfstate:/bitnami/etcd/data
- name: Generate Terraform backend config
delegate_to: localhost
template:
src: backend.tfvars.j2
dest: "{{ playbook_dir }}/../infra/backend.tfvars"