diff --git a/main.tf b/main.tf index 4bd908d..078b50b 100644 --- a/main.tf +++ b/main.tf @@ -18,11 +18,23 @@ provider "libvirt" { uri = "qemu+ssh://root@atlas.lan/system" } +locals { + ansible_command = join(" ", [ + "ANSIBLE_ROLES_PATH=roles", + "ANSIBLE_HOST_KEY_CHECKING=False", + "ANSIBLE_VAULT_PASSWORD_FILE=util/secret-service-client.sh", + "ansible-playbook", + "-u root", + "-i '192.168.30.7,'", + "hermes.yml" + ]) +} + module "vm" { source = "git::https://git.pim.kunis.nl/home/tf-modules.git//debian" name = "hermes" use_host_cert = false fixed_address = "192.168.30.7/24" - ansible_command = "ANSIBLE_ROLES_PATH=roles ANSIBLE_HOST_KEY_CHECKING=False ANSIBLE_VAULT_PASSWORD_FILE=util/secret-service-client.sh ansible-playbook -u root -i '192.168.30.7,' hermes.yml" + ansible_command = local.ansible_command mac = "CA:FE:C0:FF:EE:07" }