N
N
neothesilent2016-06-21 14:44:57
System administration
neothesilent, 2016-06-21 14:44:57

How to build an image through packer with roles, where ansible vault is used?

Hello, I'm building
a virtual box image via packer , using provisions via ansible-local , you can see an example packer configuration file here . There is a problem when building the image if the roles use encrypted variables via ansible vault, for example, ssh keys, or some kind of password that you do not want to shine in the repository.
On the github there are options on how to get around this, here is one of them, but these options do not work for me. I don't understand.. Maybe someone knows how to decrypt variables in roles using ansible vault when building an image through packer?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Pavlov, 2016-06-22
@NikiN

1. According to docs.ansible.com/ansible/playbooks_vault.html
you create a file containing the key : value
2. Include it in the playbook
3. Run the playbook with the parameter --vault-password-file vault_pass.txt
where in the file vault_pass.txt the password from file generated by ansible-vault

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question