This repository has been archived on 2023-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
tf-debian-vm/files/cloud_init.cfg.tftpl

54 lines
881 B
Text
Raw Normal View History

2023-04-05 14:48:38 +00:00
#cloud-config
hostname: "${name}"
manage_etc_hosts: true
disable_root: false
2023-04-28 08:51:17 +00:00
timezone: Europe/Amsterdam
2023-04-25 20:33:57 +00:00
2023-04-28 08:51:17 +00:00
ssh_authorized_keys:
2023-04-05 14:48:38 +00:00
%{ for key in admin_authorized_keys ~}
- "${key}"
%{ endfor ~}
2023-04-25 20:33:57 +00:00
2023-04-05 14:48:38 +00:00
%{ if insecure_password }
chpasswd:
list: |
root:root
expire: False
2023-04-05 18:01:14 +00:00
ssh_pwauth: true
%{ else }
ssh_pwauth: false
2023-04-05 14:48:38 +00:00
%{ endif }
2023-04-25 20:33:57 +00:00
2023-04-05 14:48:38 +00:00
%{ if use_host_cert }
ssh_keys:
ed25519_private: |
${indent(4, private_key)}
ed25519_certificate: "${host_cert}"
%{ endif}
2023-04-25 20:33:57 +00:00
2023-04-05 14:48:38 +00:00
write_files:
- path: /etc/default/locale
content: |
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
- path: /etc/locale.gen
content: |
en_US.UTF-8 UTF-8
2023-04-25 20:33:57 +00:00
2023-04-05 14:48:38 +00:00
runcmd:
- dhclient -r
- dhclient
- locale-gen
2023-04-25 20:33:57 +00:00
%{ if data_share != null }
2023-04-26 11:22:03 +00:00
mounts:
- ["data", "${data_share}", "9p", "trans=virtio,rw", "0", "0"]
2023-04-25 20:33:57 +00:00
%{ endif }
2023-04-17 07:31:30 +00:00
%{ if fixed_dns != "" }
manage_resolv_conf: true
resolv_conf:
nameservers:
- "${fixed_dns}"
%{ endif }