Update cloud-init-vm.yaml.tftpl

This commit is contained in:
2025-08-27 19:00:51 +00:00
parent 62af6c9c28
commit 2bfaa72d81

View File

@ -3,23 +3,28 @@ package_update: true
%{ if length(each.value.extra_packages) > 0 }
packages:
%{ for pkg in each.value.extra_packages }
- ${pkg}
${" "}- ${pkg}
%{ endfor }
%{ endif }
%{ if length(each.value.extra_users) > 0 }
users:
%{ for u in each.value.extra_users }
- name: ${u.name}
groups: [${join(", ", u.groups)}]
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
${" "}- name: ${u.name}
${" "}${" "}groups:
%{ if length(u.groups) > 0 }
%{ for g in u.groups }
${" "}${" "}${" "}- ${g}
%{ endfor }
%{ endif }
${" "}${" "}shell: /bin/bash
${" "}${" "}sudo: ALL=(ALL) NOPASSWD:ALL
%{ endfor }
chpasswd:
list:
%{ for u in each.value.extra_users }
${u.name}:${u.password}
${" "}${" "}- ${u.name}:${u.password}
%{ endfor }
expire: false
%{ endif }