Commit Graph

9 Commits

Author SHA1 Message Date
Dan Fuchs 492bff474b Ansible provisioner: Specify full path to generated inventory file 2017-04-04 22:04:26 -05:00
Dan Fuchs 609e70face inventory_directory option for ansible provisioner
Add an `inventory_directory` setting to the Ansible provisioner that
allows a user to specify a directory in which the Packer Ansible
provisioner would write the generated inventory file.  If a value is
specified for this setting, then have the Packer Ansible provisioner
pass this directory as the -i arg when it calls ansible.

This would allow an Ansible playbook used by the Packer Ansible
provisioner to use variables specified in `host_vars` and `group_vars`
in this inventory directory.
2017-04-04 16:43:46 -05:00
Andrey Chernih 7548024720 More verbose error message when ansible-playbook fails
I've spent 1 hour today debugging why packer does not want to work with
ansible. It turns out `ansible-playbook` command was returning non-zero
exit status because of the file system permission problem.

Output before change:

    % packer build rabbitmq.json
    amazon-ebs output will be in this color.

    1 error(s) occurred:

    * exit status 1

Output after change:

    amazon-ebs output will be in this color.

    1 error(s) occurred:

    * Error running "ansible-playbook --version": exit status 1
2017-03-21 20:26:41 -07:00
Ricard Clau 049fb2d9c1 actually check for errors in functional tests 2016-07-07 20:01:23 +01:00
Ricard Clau 0c81e49f83 Adding a functional test with an Ansible message very long 2016-07-07 01:12:57 +01:00
Rickard von Essen d6716f6ee1 Ansible: don't use deprecated ssh options when ver above 2.0
Ansible 2.0 deprecated ansible_ssh_user, ansible_ssh_port, ansible_ssh_host
instead use ansible_user, ansible_port, and ansible_host in the
inventory file.

Closes #3275
2016-03-07 13:26:22 +01:00
Billie Cleek a5ab53bf5e update ansible tests
Update tests to account for changes made in #3149
2016-02-10 14:16:02 -08:00
Billie H. Cleek 5366393f9f fix tests 2015-10-31 10:39:33 -07:00
Billie H. Cleek cc8ca3098e add ansible provisioner 2015-10-31 10:39:33 -07:00