From 04ccb1c29e103813d40ca0312d2fa6641fd00723 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Mon, 13 Mar 2023 11:14:42 +0100 Subject: [PATCH] try ansible pull --- cloud_init.cfg.tftpl | 5 +++++ local.yml | 5 +---- main.tf | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cloud_init.cfg.tftpl b/cloud_init.cfg.tftpl index 66bd3c3..74f2d41 100644 --- a/cloud_init.cfg.tftpl +++ b/cloud_init.cfg.tftpl @@ -15,3 +15,8 @@ packages: package_update: true package_upgrade: true package_reboot_if_required: true +ansible: + install_method: pip + pull: + url: "https://gitlab.com/pizzapim/dmz-dns-vm.git" + playbook_name: local.yml diff --git a/local.yml b/local.yml index bd5520a..269f2e5 100644 --- a/local.yml +++ b/local.yml @@ -5,8 +5,5 @@ - name: ensure file exists copy: content: "" - dest: /home/pim/testje.txt + dest: ~/testje.txt force: false - group: sys - owner: root - mode: 0555 diff --git a/main.tf b/main.tf index caff4bc..d31751d 100644 --- a/main.tf +++ b/main.tf @@ -50,7 +50,7 @@ resource "libvirt_domain" "ubuntu" { cloudinit = libvirt_cloudinit_disk.cloudinit.id - provisioner "local-exec" { - command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -T 60 -u root -i inventory ansible.yml" - } + #provisioner "local-exec" { + # command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -T 60 -u root -i inventory ansible.yml" + #} }