0
我想用Packer和Ansible作爲供應商來構建Windows AMI。Ansible通過WinRM連接,但掛起第一步
$ packer --version 1.0.3
$ ansible --version ansible 2.2.0.0
Ansible似乎連接成功,但隨後掛在劇本的第一步,下載7zip的。以下是我的Packer模板和Ansible playook的示例。
帕克
{
"builders": [{
"type": "amazon-ebs",
"region": "us-west-2",
"source_ami": "ami-09f47d69",
"instance_type": "m4.large",
"ami_name": "Packer windows test",
"user_data_file": "./scripts/ec2bootstrap.ps1",
"communicator": "winrm",
"winrm_username": "Administrator"
}],
"provisioners": [
{
"type": "powershell",
"scripts": [
"./scripts/ec2config.ps1",
"./scripts/bundleconfig.ps1"
]
},
{
"type": "ansible",
"playbook_file": "../ansible/base_ami_site.yml",
"extra_arguments": [
"--connection", "packer",
"--extra-vars", "ansible_shell_type=powershell ansible_shell_executable=None -vvvv"
]
}]}
Ansible樣品
- name: Download 7-Zip Installer
win_get_url:
url: http://www.7-zip.org/a/7z1604-x64.msi
dest: C:\Users\Administrator\Downloads\7-zip.msi
force: no
只是重申,它不會連接,但沒有運行。