Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Insert your own ca root certificates in RancherOS

Cloud-init is pretty great. It has a module for installing CA certificates, which RancherOS does not yet support. So the solution for now, as shared by Gizmotronic at the rancherOS forums, is as follows.

write_files:
- content: |+
    #!/bin/sh
    cat << _EOF_ >> /etc/ssl/certs/ca-certificates.crt
    # subject=/DC=com/DC=example/DC=ad/CN=CA2
    -----BEGIN CERTIFICATE-----
    certificate contents belong here
    -----END CERTIFICATE-----
    _EOF_
  owner: root:root
  path: /opt/rancher/bin/start.sh
  permissions: "0755"

Comments