Code Monkey home page Code Monkey logo

ansible-docker-swarm's Introduction

Docker Swarm

Create and manage Docker Swarm.

1   Requirements

  • Debian 10
  • Docker Engine

2   Role Vars

2.1   docker_swarm_state

Passed as is to the docker_swarm module. Set to present to create a new single-node cluster or join an existing cluster.

2.2   docker_swarm_advertise_addr

Passed as is to the docker_swarm module. Optional.

2.3   docker_swarm_node_role

Passed as is to the docker_node module.

2.4   docker_swarm_node_labels

Passed as is to the docker_node module. Optional.

2.5   docker_swarm_managers

A list of inventory hostnames of the manager nodes. Used to update the state of worker nodes.

2.6   docker_swarm_remote_addrs

Passed as is to the docker_swarm module. Used to join new nodes.

2.7   docker_swarm_secrets

List of dictionaries with keys key, value, state. Optional.

3   Example

3.1   Create a new swarm

# host_vars/node-0.yml
docker_swarm_state: present
docker_swarm_node_role: manager

# host_vars/node-1.yml
docker_swarm_state: join
docker_swarm_node_role: worker
docker_swarm_managers: ["node-0"]
docker_swarm_remote_addrs:
  - "{{ hostvars['node-0']['ansible_default_ipv4']['address'] }}"

# host_vars/node-2.yml
docker_swarm_state: join
docker_swarm_node_role: worker
docker_swarm_managers: ["node-0"]
docker_swarm_remote_addrs:
  - "{{ hostvars['node-0']['ansible_default_ipv4']['address'] }}"

3.2   Set Node Labels

docker_swarm_node_labels:
  label0: value0
  label1: value1
  label2: value2

3.3   Create secrets

docker_swarm_secrets:
  - name: secret-name-0
    value: secret-value-0
    state: present
  - name: secret-name-1
    value: secret-value-1
    state: absent

ansible-docker-swarm's People

Contributors

dependabot[bot] avatar rremizov avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

heartshare

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.