GithubHelp home page GithubHelp logo

karvounis / ansible-docker-swarm-management-role-example Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 11 KB

This repo contains the advanced examples for the Ansible Docker Swarm Management role https://github.com/karvounis/ansible-docker-swarm-management-role.

Home Page: https://github.com/karvounis/ansible-docker-swarm-management-role.

License: MIT License

Ruby 5.19% Jinja 94.81%
ansible ansible-role ansible-playbook ansible-roles ansible-galaxy tutorial example

ansible-docker-swarm-management-role-example's Introduction

Docker Swarm Management Examples

This repo contains the advanced examples for the Ansible Docker Swarm Management role https://github.com/karvounis/ansible-docker-swarm-management-role.

Dependencies

Execute ansible-galaxy install -r requirements.yml to download the dependencies.

Folder structure

$ tree -L 2

├── ansible.cfg
├── ansible_collections
├── inventory
│   ├── group_vars
│   └── hosts
├── LICENSE
├── playbooks
│   ├── swarm-stacks-cleanup.yml
│   └── swarm-stacks.yml
├── README.md
├── requirements.yml
├── roles
└── templates
    ├── configs
    └── stacks

Important folders

  • /inventory: Contains the hosts file (using local connection) and the variables for the role.
  • /playbooks: Contains the playbooks to execute.
  • /templates: Contains the template files for the Docker configs and stacks.

Playbooks

Create resources

Executing ansible-playbook playbooks/swarm-stacks.yml will create the following resources:

  • Networks
    • example_network_mysql
    • example_network_postgres
  • Volumes
    • example_data_mysql
    • example_data_postgres
  • Secrets
    • example_secret_mysql
    • example_secret_postgres
  • Configs
    • example_config_one
    • example_config_two
    • example_config_three
    • example_config_four
  • Stacks
    • example_stack_mysql
    • example_stack_postgres

The resources with the suffix _mysql are external dependencies to the example_stack_mysql stack and the ones with the _postgres suffix to the example_stack_postgres stack.

The example_stack_mysql stack is being generated by a simple docker-compose yaml file.

The example_stack_postgres stack is being generated by a Jinja2 template file.

Cleanup resources

In order to cleanup the example resources execute

docker stack rm example_stack_mysql

docker stack rm example_stack_postgres

ansible-playbook playbooks/swarm-stacks-cleanup.yml --skip-tags stacks,pip

ansible-docker-swarm-management-role-example's People

Contributors

karvounis avatar

Watchers

 avatar  avatar

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.