Update cloud-init-vm.yaml.tftpl

This commit is contained in:
2025-08-27 18:19:17 +00:00
parent 13d33506e6
commit 79a8acb794

View File

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