Ansible playbook for setting up a single master DC/OS cluster on Packet Cloud. The cluster will consists of nodes with bootstrap, master, public agent and agent roles.
Frank Scholten @Frank_Scholten
Run ansible-galaxy install -r requirements.yml
to install the Ansible dependencies.
Create 5 machines or cloud instances, 1 bootstrap, 1 master, 1 public agent and one more agents.
Add their hostnames and IPs to /etc/hosts
Edit the example inventory
file. See the example below.
SSH into the nodes so your pub key is authorized and Ansible SSH works
Test connectivity with ansible -i inventory -m ping all
Use the example inventory file and set the IP addresses.
[bootstrap]
bootstrap ansible_ssh_host=1.1.1.1 ansible_user=root
[masters]
master ansible_ssh_host=2.2.2.2 ansible_user=root
[agents]
agent1 ansible_ssh_host=3.3.3.3 ansible_user=root
agent2 ansible_ssh_host=4.4.4.4 ansible_user=root
[pubagents]
agent3 ansible_ssh_host=5.5.5.5 ansible_user=root
$ ansible-playbook -i inventory playbook.yml
After the cluster is installed the bootstrap node can be removed to save costs.
Add an IP to local_ips
list in vars.yaml.example
and run
$ ansible-playbook -i inventory playbook.yml -t firewall
This will update the ipset rules. To learn more about the firewall read this blog post
A Vagrant environment is available for local testing of setups.
Requirements:
A sample vars file is available under tests/vars.yaml.sample
, which should be copied
to the project root folder as vars.yaml
and adapted as necessary (particularly local_ips
).
VM hosts (and respective static IP addresses) are defined in the tests/vagrant-hosts.yml
YAML file.
To provision the testing environment execute $ vagrant up
in the project root.