amazon-ebs: ERROR! The vault password file was not found

376 views
Skip to first unread message

Muralikrishna Gutha

unread,
May 21, 2019, 11:48:34 AM5/21/19
to Packer

I am kind of new to using packer and having issues with running AMI builds, Build fails with `amazon-ebs: ERROR! The vault password file  was not found` any help/direction is appreciated. 
Please let me know if you need see any additional details 


"provisioners": [
{
"type": "shell",
"inline": [
"sudo apt-get update",
"echo here",
"sudo apt-get install -y ansible"
]
},
{
"playbook_file": "/Users/mgutha/Desktop/packer_Cassandra.yaml",
"role_paths": ["/Users/mgutha/Desktop/GitRepo/cassandra-ansible/roles/ansible_mgmt",
"/Users/mgutha/Desktop/GitRepo/cassandra-ansible/roles/virtualenv_ve27",
"/Users/mgutha/Desktop/GitRepo/cassandra-ansible/roles/ldap_setup"
],
"group_vars": "/Users/mgutha/Desktop/packer_var",
"extra_arguments": [
"--extra-vars",
"--vault-id",
"preprod@Users/mgutha/.ansible/vault/preprod_vault.txt"
],
"type": "ansible-local",
"pause_before": "10s"
}



ERROR from log file


2019/05/21 11:04:51 ui:     amazon-ebs: Executing Ansible: cd /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350 && ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350/packer_Cassandra.yaml --extra-vars "packer_build_name=amazon-ebs packer_builder_type=amazon-ebs packer_http_addr= -o IdentitiesOnly=yes" --vault-id preprod@Users/mgutha/.ansible/vault/preprod_vault.txt -c local -i /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350/packer-provisioner-ansible-local984352577
2019/05/21 11:04:51 packer: 2019/05/21 11:04:51 [DEBUG] Opening new ssh session
2019/05/21 11:04:51 packer: 2019/05/21 11:04:51 [DEBUG] starting remote command: cd /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350 && ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350/packer_Cassandra.yaml --extra-vars "packer_build_name=amazon-ebs packer_builder_type=amazon-ebs packer_http_addr= -o IdentitiesOnly=yes" --vault-id preprod@Users/mgutha/.ansible/vault/preprod_vault.txt -c local -i /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350/packer-provisioner-ansible-local984352577
2019/05/21 11:04:52 ui error: ==> amazon-ebs: ERROR! The vault password file /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350/Users/mgutha/.ansible/vault/preprod_vault.txt was not found
2019/05/21 11:04:52 packer: 2019/05/21 11:04:52 [ERROR] Remote command exited with '1': cd /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350 && ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350/packer_Cassandra.yaml --extra-vars "packer_build_name=amazon-ebs packer_builder_type=amazon-ebs packer_http_addr= -o IdentitiesOnly=yes" --vault-id preprod@Users/mgutha/.ansible/vault/preprod_vault.txt -c local -i /tmp/packer-provisioner-ansible-local/5ce41330-d37c-baa5-0b4a-a5353f37d350/packer-provisioner-ansible-local984352577
2019/05/21 11:04:52 packer: 2019/05/21 11:04:52 [INFO] RPC endpoint: Communicator ended with: 1


Rickard von Essen

unread,
May 21, 2019, 3:13:59 PM5/21/19
to packe...@googlegroups.com
Ansible-local is running on the VM you are packaging but it seems like you reference a local file (on the host) for the vault password. You need to transfer it with the file provisioner before, and be sure to delete it after you have executed ansible-local. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/b13aa74c-971c-453a-925e-b97296d78afc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Muralikrishna Gutha

unread,
May 21, 2019, 3:16:11 PM5/21/19
to packe...@googlegroups.com
Yup tried that and that seems to be working. Thanks for your response. 


For more options, visit https://groups.google.com/d/optout.
--
Thanks & Regards
  Murali K Gutha
Reply all
Reply to author
Forward
0 new messages