2023-06-22 05:16:40 +00:00
|
|
|
#cloud-config
|
2023-06-24 19:57:08 +00:00
|
|
|
# See: the cloudinit cloud-config spec
|
|
|
|
hostname: {{ .Hostname }}
|
|
|
|
|
|
|
|
# add some users...
|
|
|
|
#users:
|
|
|
|
# - name: test
|
|
|
|
# plain_text_passwd: test
|
|
|
|
# groups: sudo
|
|
|
|
# sudo: ALL=(ALL) NOPASSWD:ALL
|
|
|
|
# shell: /bin/bash
|
|
|
|
# lock_passwd: false
|
|
|
|
|
|
|
|
# Not recommended, you should really create the VM with a root ssh key
|
|
|
|
#chpasswd:
|
|
|
|
# list: |
|
|
|
|
# root: somepassword
|
|
|
|
# expire: False
|
2023-06-22 05:16:40 +00:00
|
|
|
|
|
|
|
write_files:
|
2023-06-24 19:57:08 +00:00
|
|
|
{{ if ne .InitScriptBase64 "" }}# Additional optional script to run in cloud init post
|
2023-06-22 05:16:40 +00:00
|
|
|
- path: /root/.cloud-init-user.sh
|
|
|
|
encoding: b64
|
|
|
|
content: {{ .InitScriptBase64 }}
|
|
|
|
owner: root:root
|
|
|
|
permissions: '0755'
|
2023-06-24 19:57:08 +00:00
|
|
|
{{ end -}}
|
|
|
|
{{ if ne .AuthorizedKeys "" }}# Root Keys
|
|
|
|
- path: /root/.ssh/authorized_keys
|
|
|
|
encoding: b64
|
|
|
|
content: {{ .AuthorizedKeys }}
|
|
|
|
owner: root:root
|
|
|
|
permissions: '0600'
|
|
|
|
{{ end -}}
|
2023-06-22 05:16:40 +00:00
|
|
|
|
|
|
|
{{ if ne .InitScriptBase64 "" -}}
|
|
|
|
runcmd:
|
|
|
|
- /root/.cloud-init-user.sh
|
|
|
|
{{ end }}
|