Created
April 10, 2021 06:19
-
-
Save amaudy/5004ae82e147d9e40e7e58c77c589617 to your computer and use it in GitHub Desktop.
Revisions
-
amaudy created this gist
Apr 10, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ { "variables": { "aws_access_key": "ACCESSKEY", "aws_secret_key": "SECRETKEY", "aws_subnet_id": "SUBNETID" }, "builders": [ { "type": "amazon-ebs", "access_key": "{{user `aws_access_key`}}", "secret_key": "{{user `aws_secret_key`}}", "subnet_id": "{{user `aws_subnet_id`}}", "region": "us-east-1", "instance_type": "t3.micro", "ami_name": "bookapp-{{timestamp}}", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "*ubuntu/images/*ubuntu-focal-20.04-amd64-server-*", "root-device-type": "ebs" }, "owners": ["xxx"], "most_recent": true }, "security_group_filter": { "filters": { "tag:Class": "packer" } }, "ssh_username": "ubuntu" } ], "provisioners": [ { "type": "shell", "max_retries": 5, "inline": [ "sudo apt-get update -y && sudo apt-get upgrade -y", "sudo apt install python -y" ] }, { "type": "ansible", "playbook_file": "/home/amaudy/ansible/playbooks/apache.yml", "groups": ["web"] } ] }