Files
linux-cloud-router/examples/cloud-init-with-pki.yaml.tpl
T

47 lines
1.2 KiB
Smarty

#cloud-config
#
# Example: install and configure linux-manager during first boot, with its
# issuing CAs signed by a Simple CA service. The template variables are
# Terraform templatefile() placeholders: config holds pki.root simple-ca and
# pki.simple_ca_url, setup_code is the one-time setup code of a sign-ca token,
# and trusted_cas the PEM certificates of CAs added to the trust store, among
# them the CA of the service's HTTPS certificate.
hostname: ${hostname}
fqdn: ${fqdn}
manage_etc_hosts: false
apt:
sources:
linux-manager:
source: "deb [signed-by=/etc/apt/keyrings/linux-manager.asc] ${repo_url} ${ubuntu_codename} main"
key: |
${indent(8, trimspace(repo_gpg_key))}
write_files:
- path: /etc/linux-manager/linux-manager.json
permissions: '0600'
owner: root:root
content: |
${jsonencode(config)}
- path: /etc/linux-manager/pki-setup-code
permissions: '0600'
owner: root:root
content: |
${setup_code}
%{ if length(trusted_cas) > 0 ~}
ca_certs:
trusted:
%{ for ca in trusted_cas ~}
- |
${indent(6, trimspace(ca))}
%{ endfor ~}
%{ endif ~}
package_update: true
packages:
- linux-manager