I do something similar to this to store sensitive files in vault. I base64
encode the data and set the variable with the resulting encoded string.
Then in my template I use the b64decode filter when applying the variable.
in your vault file
private_key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1J....
then in your private_key template add
{{private_key | b64decode}}
This has worked very well for me this far.
thanks,
Steve.
On Sunday, 27 July 2014 20:14:19 UTC+1, [email protected] wrote:
>
> I think we do something similar with SSL certificates.
>
> First, we use the multi-line YAML notation ni the vars file:
> ssl_private_key: |
> -----BEGIN RSA PRIVATE KEY-----
> ETC...
>
> Note the spacing in front of the lines, that's required.
> In case you don't need the actual newlines on the other end, you can also
> use ">" instead of "|"
>
> And then we have a template "templates/ssl_private_key.j2" with just the
> variable as content:
> {{ ssl_private_key }}
>
> --
> Ramon
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/c1730d51-e52b-476f-9366-cda0c08f3d1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.