November 2017
Intermediate to advanced
298 pages
7h 10m
English
Using Packer is actually relatively easy as all you need in most cases is the Ansible setup code and a relatively small packer.json file. Add this content to packer.json in our Ansible deployment configuration from the earlier section:
{ "builders": [ { "ami_description": "Cluster Node Image", "ami_name": "cluster-node", "associate_public_ip_address": true, "force_delete_snapshot": true, "force_deregister": true, "instance_type": "m3.medium", "region": "us-west-1", "source_ami": "ami-1c1d217c", "ssh_username": "ubuntu", "type": "amazon-ebs" } ], "provisioners": [ { "inline": "sudo apt-get update && sudo apt-get install -y ansible", "type": "shell" }, { "playbook_dir": ".", "playbook_file": "swarm_node.yml", "type": "ansible-local"Read now
Unlock full access