From 548b00070032def9857d535b7b2b44b28389efbf Mon Sep 17 00:00:00 2001 From: Gevorg-Khachatryaan Date: Mon, 11 Sep 2023 14:02:39 +0400 Subject: [PATCH] example for VMs with guest customization file which injects variables from the playbook --- examples/vm.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/vm.yml b/examples/vm.yml index ebb7da68d..f88ab7064 100644 --- a/examples/vm.yml +++ b/examples/vm.yml @@ -17,6 +17,19 @@ script_path: "" subnet_name: "" image_name: "" + password: "" + fqdn: "" + + - name: Create Cloud-init Script file + copy: + dest: "cloud_init.yml" + content: | + #cloud-config + chpasswd: + list: | + root: "{{ password }}" + expire: False + fqdn: "{{ fqdn }}" - name: create Vm ntnx_vms: @@ -47,7 +60,7 @@ memory_gb: 1 guest_customization: type: "cloud_init" - script_path: "{{ script_path }}" + script_path: "./cloud_init.yml" is_overridable: True register: output