Created
April 1, 2016 15:57
-
-
Save davidfic/dd16836a5ec406473ea29698e6b3021f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"aws_access_key": "", | |
"aws_secret_key": "", | |
"region": "", | |
"vpc_id": "", | |
"subnet_id": "", | |
"security_group_ids": "", | |
"source_ami": "", | |
"ssh_username": "", | |
"instance_type": "", | |
"iam_instance_profile": "", | |
"packer_profile": "packer" | |
}, | |
"builders": [{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", | |
"region": "{{user `region`}}", | |
"source_ami": "{{user `source_ami`}}", | |
"instance_type": "{{user `instance_type`}}", | |
"ssh_username": "{{user `ssh_username`}}", | |
"ami_name": "Foundation Image {{timestamp}}", | |
"vpc_id": "{{user `vpc_id`}}", | |
"iam_instance_profile": "{{user `packer_profile`}}", | |
"security_group_ids": ["{{user `security_group_ids`}}"], | |
"subnet_id": "{{user `subnet_id`}}", | |
"tags": {"name": "Foundation Image"} | |
}], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"execute_command": "echo 'packer' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", | |
"inline": [ | |
"apt-get install -y software-properties-common", | |
"apt-add-repository ppa:ansible/ansible -y", | |
"/usr/bin/apt-get update", | |
"/usr/bin/apt-get -y install ansible" | |
] | |
}, | |
{ | |
"type": "ansible-local", | |
"playbook_file": "foundation-playbook.yml", | |
"inventory_file": "hosts" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment