My Packer Version 1.6.0
Hello,
The official docs says, if the inventory_file
string is not specified, Packer will create a temp inventory file. But in my case its not creating any file and it fails. Could you please clarify me what was wrong here?
Provisioner code block:
"provisioners": [
{
"type": "ansible",
"user": "user1",
"use_proxy": "false",
"extra_arguments": [ "--extra-vars", "account_file={{user `account_file`}} nexus_pwd={{user `nexus_pwd`}} nexus_user={{user `nexus_user`}}" ],
"ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False" ],
"playbook_file": "/home/user1/test.yml"
}
]
Output:
==> googlecompute: Executing Ansible: ansible-playbook -e packer_build_name=googlecompute -e packer_builder_type=googlecompute -e packer_http_addr=ERR_HTTP_ADDR_NOT_IMPLEMENTED_BY_BUILDER --ssh-extra-args '-o IdentitiesOnly=yes' --extra-vars account_file=/opt/key.json nexus_pwd=xxxx nexus_user=xxxx -e ansible_ssh_private_key_file=/tmp/ansible-key210193160 -i /tmp/packer-provisioner-ansible452653767 /home/user1/test.yml
googlecompute: [WARNING]: Could not match supplied host pattern, ignoring: ihs
googlecompute:
googlecompute: PLAY [Ansible Playbook to install Test YAML] *************************
googlecompute: skipping: no hosts matched
googlecompute:
googlecompute: PLAY RECAP *********************************************************************
googlecompute:
2020/09/04 16:56:32 [INFO] (telemetry) ending ansible