UPDATED RECIPES AVAILABLE HERE
A simple Packer template to build:
- An AMI using Ubuntu 13.10 in AWS USW-2 (Oregon) region.
- A Virtualbox Vagrant box.
Includes:
vagrant up
packer build template.json
Using User data we can setup the Serf role:
ec2-run-instances --key your-key -g security-group --user-data-file user-data-file/master your-ami --region us-west-2
ec2-run-instances --key your-key -g security-group --user-data-file user-data-file/route your-ami --region us-west-2
ec2-run-instances --key your-key -g security-group --user-data-file user-data-file/build your-ami --region us-west-2
ec2-run-instances --key your-key -g security-group --user-data-file user-data-file/serve your-ami --region us-west-2
This repo pulls example handlers from darron/serf-docker-events - it could be any handlers at all.
Inside /etc/default/serf you can configure an EVENTS_DIR that contains all of your handlers.
You can also configure an alternate SUFFIX if you prefer to write your handlers in a language other than Bash/sh.
If that EVENTS_DIR exists the serf.conf Upstart script will look for files ending in SUFFIX and add them as event handlers.
Better error checking, etc.