From 97c2d8b36e07857643417c7b65fd52743a25957a Mon Sep 17 00:00:00 2001 From: Gevorg Khachatryan Date: Tue, 31 Oct 2023 00:48:47 +0400 Subject: [PATCH] example for VMs with guest customization file which injects variables from the playbook (#396) Co-authored-by: Gevorg-Khachatryaan --- 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