Created
October 26, 2017 15:36
-
-
Save Ohadbasan/0319f3921e3fa4f21183a13c34fda476 to your computer and use it in GitHub Desktop.
packer.json
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
{ | |
"builders": [{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", | |
"region": "us-east-1", | |
"ami_regions" : ["us-east-1"], | |
"source_ami": "ami-13be557e", | |
"instance_type": "c4.large", | |
"ssh_username": "ubuntu", | |
"ami_virtualization_type": "hvm", | |
}, | |
{ | |
"type": "googlecompute", | |
"account_file": "account.json", | |
"project_id": "xxx-01", | |
"source_image": "ubuntu-1604-xenial-v20171011", | |
"zone": "us-central1-a", | |
"image_name": "img-{{timestamp}}", | |
"ssh_username": "ubuntu" | |
} | |
], | |
"provisioners": [{ | |
"type": "shell", | |
"inline": [ | |
"sleep 30", | |
"sudo apt-add-repository -y ppa:ansible/ansible", | |
"sudo apt-get update", | |
"sudo apt-get -y dist-upgrade", | |
"sudo apt-get install -y unattended-upgrades", | |
"sudo unattended-upgrades", | |
"sudo apt-get install -y ansible dmsetup", | |
"sudo ansible-galaxy install angstwad.docker_ubuntu", | |
"sudo chown -R ubuntu:ubuntu /home/ubuntu/.ansible", | |
"sudo reboot", | |
"sleep 60" | |
]}, | |
{ | |
"type": "ansible-local", | |
"playbook_file": "provision_.yml" | |
}, | |
{ | |
"type":"shell", | |
"inline": [ | |
"sudo apt-get install -y python-pip aufs-tools software-properties-common ansible python-pycurl linux-image-extra-$(uname -r) apt-transport-https ca-certificates unzip libwww-perl libdatetime-perl ntp htop iotop", | |
"sudo reboot", | |
"sleep 60" | |
]} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment