Skip to content

Instantly share code, notes, and snippets.

@visnup
Created June 15, 2017 00:06
Show Gist options
  • Save visnup/978a7fc9c4688d04e93f0021b27f7db3 to your computer and use it in GitHub Desktop.
Save visnup/978a7fc9c4688d04e93f0021b27f7db3 to your computer and use it in GitHub Desktop.
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-4fc1c025",
"instance_type": "t2.small",
"ssh_username": "ubuntu",
"ami_name": "coolapp {{timestamp}}",
"iam_instance_profile": "your_instance_iam_profile",
"run_tags": {"Name": "coolapp"},
"run_volume_tags": {"Name": "coolapp"},
"tags": {"Name": "coolapp"}
}],
"provisioners": [
{
"type": "shell",
"inline": ["sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367",
"sudo bash -c \"echo 'deb http://ppa.launchpad.net/ansible/ansible/ubuntu vivid main' > /etc/apt/sources.list.d/ansible.list\"",
"sudo apt-get update",
"sudo apt-get -y install ansible"]
},
{
"type": "ansible-local",
"playbook_file": "{{ template_dir }}/playbook.yml",
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment