Bakes tasty AMIs, just for you!
Packer + Ansible = <3
Go here
-
providers
- cloud providers and their image setsimages
- sets of Ansible roles that can be ran against an instance to create a machine image for the given provider Animage
will translate into anami
or the provider-specific version of a machine image.
-
roles
- ansible roles applied against a given image Plain Jane Ansible roles.
This requires:
- packer
- docker (on the host)
- IAM role
Bake AMI from Ansible roles using Packer
Usage: build.sh -p PROVIDER
-i IMAGE
-r REGION [-r OTHER_REGION]
-m MULTI-ACCOUNT_PROFILE
-v 'var1_name=value1' [-v 'var2_name=value2']
-d
--disable-azure-compatibility
Options:
--disable-azure-compatibility disable azure compatibility
-d,--debug enable debug mode
-i,--image image to provision
-m,--multiaccountprofile awscli profile that can assume role to list all accounts in this org
-p,--provider provider to use (amazon|google|nocloud|...)
-r,--region regions to copy this image to (can be used multiple times)
-v,--packer-var variables and their values to pass to packer, key value pairs (can be used multiple times)
Examples:
$ AWS_PROFILE=your-profile ./build.sh \
-p amazon -i ivy-base \
-v 'datadog_api_key=your-datadog-api-key'
$ AWS_PROFILE=your-profile ./build.sh \
-p amazon -i ivy-mesos
The provided credentials do not have permission to create the service-linked role for EC2 Spot Instances
As an aws administrator run the command below:
aws --profile=your-aws-profile iam create-service-linked-role \
--aws-service-name spot.amazonaws.com
Source: here