GithubHelp home page GithubHelp logo

alexandre2602 / ansible-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stone-payments/ansible-docker

0.0 1.0 0.0 107 KB

Ansible role to setup a Docker instance

License: MIT License

Shell 31.25% Python 68.75%

ansible-docker's Introduction

stone-payments.docker

This Ansible role will setup and configure a Docker service on a RHEL-like (CentOS, Fedora also supported) system. There's also support for enabling some workarounds to improve Docker stability.

So far, there's only support for "direct-lvm" storage backend, where a whole block device is dedicated to store the container images. This is a production-ready storage backend to use, and it's the most stable one with very good performance, with the drawback of increased memory usage.

Usage

You must have a dedicated block device for the role to create a LVM PV, VG and setup the needed LVs on it. The intended device should be passed as a variable to the role, but the role will check if there's already some filesystem signature on it and abort if that's the case (set docker_vg.create to true to force overwriting).

Here's an example playbook:

- name: configure docker
  hosts: all
  become: true
  roles:
    - stone-payments.docker
  vars:
    docker_vg: #this whole dict may be omitted if you intend to use the default "/dev/sdb"
      name: docker #purely informative, but there should be a name
      create: false #wipe devices listed on docker_vg.devs
      devs: #you may use more than a single block device here if needed, they will be joined to create a VG
        - "/dev/sdb"

Advanced settings

In the defaults\main.yml file you may find advanced settings to fine-tune the role to your environment. The available options include:

  • Docker version to use (must be available on the system);
  • TLS configuration of the Docker API socket;
  • Fraction of available space to use for container images and for container-generated data;
  • Enable/disable workarounds of some Docker bugs;
  • Enable/disable some Docker plugins (so far, only support for RHEL registry plugin);
  • Custom configs that should be passed directly to /etc/docker/daemon.json config file.

Testing

This project uses py.test and testinfra packages to run tests.

First, install the dependencies and activate the virtualenv with:

pipenv install
pipenv shell

Then run tests:

pytest

You must have Docker 17.06 or greater on your machine since the tests run inside a container and uses the --mount docker flag.

Contributing

Just open a PR! We love PRs.

License

This role is distributed under the MIT license.

ansible-docker's People

Contributors

bcdonadio avatar daniellima avatar dependabot[bot] avatar douglasquintanilha avatar jvitor03 avatar

Watchers

 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.