From 52be6c75346f4bc654cd26b154a9616cc8bf927c Mon Sep 17 00:00:00 2001 From: guppy Date: Mon, 1 May 2023 17:34:15 +0200 Subject: [PATCH] Run the local cloud-config-gen script via Ansible --- ansible/create-vm-template.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/create-vm-template.yaml b/ansible/create-vm-template.yaml index 50568bb..fcc85ac 100644 --- a/ansible/create-vm-template.yaml +++ b/ansible/create-vm-template.yaml @@ -22,6 +22,7 @@ url: "{{ vm.cloud_image_url }}" dest: "{{ vm.cloud_image_path }}" mode: 0700 + become: yes - name: Install Cloud-init apt: @@ -34,6 +35,9 @@ command: "virt-customize -a {{ vm.cloud_image_path }} --install qemu-guest-agent" become: yes + - name: Exec local script + local_action: command bash cloud-config-gen.sh + - name : Copy cloud-init-config file copy: src: cloud-init-conf.yml