willis7 / role-swarm

Ansible role for Docker Swarm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Swarm

Create Docker Swarm clusters with Ansible.

Requirements

It's assumed that Docker will be installed on each of the hosts to be included in the cluster.

Role Variables

install_type is the most important variable in this cookbook as it will decide the role the host will play in the Swarm . The options here are first_manager, manager or worker.

Example Playbook

- name: Set first swarm manager
  hosts: swarm-first-manager
  become: true
  roles:
    - {role: swarm, install_type: first_manager}

- name: Add managers
  hosts: swarm-manager
  become: true
  roles:
    - {role: swarm, install_type: manager}

- name: Add workers
  hosts: swarm-worker
  become: true
  roles:
    - {role: swarm, install_type: worker}

Testing

Dependencies:

  • Vagrant
  • Virtualbox
  • Ruby

This project uses Test Kitchen to create, provision and test the role using Inspec. With the dependencies installed you can run the tests with:

  • make install - download all test dependencies
  • make test - test (destroy, create, converge, setup, verify and destroy) one or more instances

Author Information

Additional Resources

About

Ansible role for Docker Swarm


Languages

Language:Ruby 92.4%Language:Makefile 7.6%