Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegoaceneves/d2fca50679d93ff723f2d6ce59ffeb0f to your computer and use it in GitHub Desktop.
Save diegoaceneves/d2fca50679d93ff723f2d6ce59ffeb0f to your computer and use it in GitHub Desktop.
{
"variables": {
"name": null,
"region": "us-east-1"
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `region`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*ubuntu-focal-20.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "{{user `name`}} {{timestamp}}",
"ami_description": "from {{.SourceAMI}}",
"tags": {
"OS_Version": "Ubuntu",
"Release": "Latest",
"Base_AMI_Name": "{{ .SourceAMIName }}",
"Extra": "{{ .SourceAMITags.TagName }}"
}
}
],
"provisioners": [
{
"type": "ansible",
"playbook_file": "ansible/main.yml",
"ansible_env_vars": [
"ANSIBLE_HOST_KEY_CHECKING=False",
"ANSIBLE_REMOTE_TMP=/tmp/ansible",
"ANSIBLE_BECOME=true",
"ANSIBLE_BECOME_USER=ubuntu",
"ANSIBLE_BECOME_METHOD=sudo"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment