Ansible Playbooks for setting up DC/OS on AWS. Default configuration of three masters, three slaves and two public slaves behing an AWS elastic load-balancer on a three subnet VPC, two public subnets on different availiability zones and one private subnet.
To try it out do:
-
Configure
~/.boto
as described in Boto Config:[Credentials] aws_access_key_id = <your_access_key_here> aws_secret_access_key = <your_secret_key_here>
-
Add your
*.pem
file to thessh-agent
:$ ssh-agent bash $ ssh-add ~/.ssh/<amazon key file>
-
Define the environment variables (see below). The AWS variables are mandatory.
-
Run the playbook as
ansible-playbook -i ec2.py main.yml
to set up the EC2 instances, VPC, subnets, ELB etc. -
boto3 must be installed.
-
Run the playbook as
ansible-playbook -i ec2.py provision_cluster.yml
to provision the instances with DC/OS nodes.
The following environment varibles can be configured for Ansible lookup
- EC2_TARGET_OS: the target OS for the cluster nodes and can be any of [
Ubuntu
(default),CentOS
]. Defines the AMI and SSH user for the provisioning. - EC2_TARGET_OS_VERSION: the version of the target e.g.
Xenial
for Ubuntu,7
for CentOS. - AWS_EC2_KEY_PAIR: the name of the key pair to use when provisioning the cluster (EC2 instances etc.).
- AWS_EC2_LB_CERT: the
arn
resource for the AWS ELB certificate. - AWS_S3_ELB_LOGS_BUCKET_NAME: the name of the S3 bucket where to store the ELB logs.
- DCOS_CONTROLLER_INSTALL_DEMOS:
true
- install demo(s) (default),false
- skip demo installation.
- DCOS_CONTROLLER_INSTALL_DEMO_SD_AND_LB_NGINX:
true
- install demo setting up Nginx as described in Service discovery and load balancing with DCOS and marathon-lb: Part 1. - DCOS_CONTROLLER_INSTALL_DOCKERCLOUD_HELLO_WORLD:
true
- install Dockercloud hello-world demo.