Created
January 24, 2019 20:56
-
-
Save apenney/3a97b0574e561263995668b1cec27624 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
⟩ cat packer/sl-email/main.json | |
{ | |
"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_filter": { | |
"filters": { | |
"virtualization-type": "hvm", | |
"name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*", | |
"root-device-type": "ebs" | |
}, | |
"owners": [ | |
"099720109477" | |
], | |
"most_recent": true | |
}, | |
"instance_type": "t2.xlarge", | |
"ssh_username": "ubuntu", | |
"ami_name": "sl-email-{{timestamp}}", | |
"iam_instance_profile": "adh-deploy", | |
"subnet_id": "subnet-96999fbe" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"inline": [ | |
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done" | |
] | |
}, | |
{ | |
"type": "shell", | |
"inline": [ | |
"sudo apt -qqy update && sudo apt install -qy python python-pip" | |
] | |
}, | |
{ | |
"type": "ansible", | |
"groups": [ | |
"template" | |
], | |
"inventory_directory": "./inventory", | |
"playbook_file": "playbooks/sl-email/main.yml" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment