Skip to content

Instantly share code, notes, and snippets.

@fbsdmon
Last active February 26, 2017 19:41
Show Gist options
  • Save fbsdmon/324bf8deafa24f40cd732ec0d67658d6 to your computer and use it in GitHub Desktop.
Save fbsdmon/324bf8deafa24f40cd732ec0d67658d6 to your computer and use it in GitHub Desktop.
{
"variables": {
"access_key": "",
"secret_key": "",
"username": "bppd",
"password": "changeM3",
"base_ami": "ami-6f559800",
"packer_host": "{{env `HOSTNAME`}}"
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `access_key`}}",
"secret_key": "{{user `secret_key`}}",
"ami_name": "win2012r2-{{isotime \"200601021504\"}}",
"source_ami": "{{user `base_ami`}}",
"region": "eu-central-1",
"instance_type": "t2.micro",
"vpc_id": "vpc-xxxxxx",
"subnet_id": "subnet-xxxxxx",
"security_group_id": "sg-xxxxxx",
"communicator": "winrm",
"winrm_use_ssl": true,
"winrm_insecure": true,
"winrm_port":5986,
"winrm_timeout": "20m",
"winrm_username": "{{user `username`}}",
"winrm_password": "{{user `password`}}",
"user_data_file":"./ec2-bootstrap.ps1",
"tags": {
"Name": "win2012r2-{{isotime \"200601021504\"}}",
"Owner": "Packer @{{user `packer_host`}}"
}
}
],
"provisioners": [
{
"type":"powershell",
"scripts": [
"./ec2-config.ps1",
"./ec2-bundle-config.ps1"
]
},
{
"type": "ansible",
"playbook_file": "./win2012r2.yml",
"user": "{{user `username`}}",
"extra_arguments": [
"-vvvv",
"--connection", "packer",
"--extra-vars", "ansible_shell_type=powershell ansible_shell_executable=None"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment