From 7a81d014616eae2f61156783617df71ab7877fd2 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 21 Sep 2024 18:22:48 +0200 Subject: [PATCH] Cambiamento posizione template basati su jinja. --- vm-ansible/__main__.py | 6 +++--- vm-ansible/{cloud-init => templates}/meta-data.jinja | 0 vm-ansible/{cloud-init => templates}/network-config | 0 vm-ansible/{cloud-init => templates}/user-data.jinja | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename vm-ansible/{cloud-init => templates}/meta-data.jinja (100%) rename vm-ansible/{cloud-init => templates}/network-config (100%) rename vm-ansible/{cloud-init => templates}/user-data.jinja (100%) diff --git a/vm-ansible/__main__.py b/vm-ansible/__main__.py index fd8cdc1..e829261 100644 --- a/vm-ansible/__main__.py +++ b/vm-ansible/__main__.py @@ -35,9 +35,9 @@ volume = lv.Volume("disk", # Stream configuration files cloudinit = lv.CloudInitDisk("cloud-init", - meta_data = Template(open("./cloud-init/meta-data.jinja", "r").read()).render(env), - user_data = Template(open("./cloud-init/user-data.jinja", "r").read()).render(env), - network_config = open("./cloud-init/network-config", "r").read() + meta_data = Template(open("./templates/meta-data.jinja", "r").read()).render(env), + user_data = Template(open("./templates/user-data.jinja", "r").read()).render(env), + network_config = open("./templates/network-config", "r").read() ) vm = lv.Domain(config.get('hostname'), diff --git a/vm-ansible/cloud-init/meta-data.jinja b/vm-ansible/templates/meta-data.jinja similarity index 100% rename from vm-ansible/cloud-init/meta-data.jinja rename to vm-ansible/templates/meta-data.jinja diff --git a/vm-ansible/cloud-init/network-config b/vm-ansible/templates/network-config similarity index 100% rename from vm-ansible/cloud-init/network-config rename to vm-ansible/templates/network-config diff --git a/vm-ansible/cloud-init/user-data.jinja b/vm-ansible/templates/user-data.jinja similarity index 100% rename from vm-ansible/cloud-init/user-data.jinja rename to vm-ansible/templates/user-data.jinja