Billie H. Cleek f760ab2fd8 Make SCP the default for provisioner/ansible
Add a new option, `use_sftp` to the ansible provisioner. It's default
value is false; ansible provisioner will use SCP by default.

Refactor to consistently set all configure options for ansible
provisioner in the Prepare step.

Remove incorrect information about `ANSIBLE_HOST_KEY_CHECKING=False`
being set when `ansible_env_vars` is not set in the packer template.

Update BATS tests for the ansible provisioner to actually check that the
fetched directory contains the contents expected. This revealed a
problem with the all_options template that required adding a host to the
hosts list in the test playbook.
2016-09-11 23:58:31 -07:00

31 lines
755 B
JSON

{
"variables": {},
"provisioners": [
{
"type": "shell",
"inline": [
"apt-get update",
"apt-get -y install python openssh-sftp-server",
"ls -l /usr/lib",
"#/usr/lib/sftp-server -?"
]
}, {
"type": "ansible",
"playbook_file": "./playbook.yml",
"sftp_command": "/usr/lib/sftp-server -e -l INFO",
"use_sftp": true
}
],
"builders": [
{
"type": "googlecompute",
"account_file": "{{user `account_file`}}",
"project_id": "{{user `project_id`}}",
"image_name": "packerbats-sftp-{{timestamp}}",
"source_image": "debian-7-wheezy-v20141108",
"zone": "us-central1-a"
}
]
}