Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save suz-lab/4f7d5cf3db2f217bb1c3 to your computer and use it in GitHub Desktop.
Save suz-lab/4f7d5cf3db2f217bb1c3 to your computer and use it in GitHub Desktop.
{
"variables": {
"Region": "",
"VpcId": "",
"SubnetId": "",
"Name": "",
"Epoch": "",
"SourceAmi": ""
},
"builders": [ {
"type": "amazon-ebs",
"region": "{{user `Region`}}",
"source_ami": "{{user `SourceAmi`}}",
"instance_type": "t2.micro",
"ssh_username": "ec2-user",
"vpc_id": "{{user `VpcId`}}",
"subnet_id": "{{user `SubnetId`}}",
"associate_public_ip_address": "true",
"enhanced_networking": "true",
"ami_name": "{{user `Name`}}_{{user `Epoch`}}"
} ],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo yum -y update",
"sudo pip install ansible",
"sudo mkdir /etc/ansible",
"sudo touch /etc/ansible/hosts",
"rm -f /home/ec2-user/.ssh/authorized_keys"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment