Files
ansible_proxmox_VM/templates/cloudinit_userdata.yaml.j2

32 lines
599 B
Django/Jinja

#cloud-config
hostname: {{ hostname }}
{% if domain is defined and domain %}
fqdn: {{ hostname }}.{{ domain }}
{% endif %}
users:
- name: {{ ci_user }}
sudo: ALL=(ALL) NOPASSWD:ALL
groups: sudo
shell: /bin/bash
lock_passwd: false
passwd: {{ ci_password | password_hash('sha512') }}
ssh_authorized_keys:
{% for key in ssh_public_keys %}
- {{ key }}
{% endfor %}
chpasswd:
expire: false
ssh_pwauth: true
timezone: "{{ timezone | default('UTC') }}"
package_update: true
package_upgrade: false
runcmd:
- echo "Cloud-init user-data executed for {{ hostname }}"