I'm attempting to use Jinja to automate the creation of a config file with inline certificates. For the most part, the config as a whole looks as expected with the exception of the certificates. While I can get them into the end file, the formatting is messed up and thus not working.
The expected goal is obviously
pki:
# The CAs that are accepted by this node. Must contain one or more certificates created by 'nebula-cert ca'
ca: |
-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----
cert: |
-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----
key: |
-----BEGIN X25519 PRIVATE KEY-----
<snip>
-----END X25519 PRIVATE KEY-----
But I'm ending up with
pki:
# The CAs that are accepted by this node. Must contain one or more certificates created by 'nebula-cert ca'
ca: |
-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----
cert: |
-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----
key: |
-----BEGIN X25519 PRIVATE KEY-----
<snip>
-----END X25519 PRIVATE KEY-----
The snippet from my Jinja template looks like this:
pki:
ca: |
{{ca}}
cert: |
{{hostCert}}
key: |
{{hostKey}}
The template is obviously lined up, but I'm obviously missing some form of formatting. I've attempted to use the |center(x) formatting but it's not working... or doing anything that I can see. Does anyone have advice on getting the certificates to align properly so that they're read correctly?