GithubHelp home page GithubHelp logo

jobcespedes / multienv Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 48 KB

A stackable multienvironment directory layout for Ansible using unionfs and docker

License: Apache License 2.0

Dockerfile 0.39% Python 98.28% Shell 1.33%
ansible docker unionfs ansible-role role container

multienv's Introduction

Role Name: multienv

Build Status Buy me a coffee

Description: A stackable multienvironment directory layout for Ansible using unionfs. Check this Github project with demo data for the environments

There are three methods to run unionfs binary. From unionfs binary in the host, a docker container or a podman container.

Requirements

Using unionfs host binary

  • unionfs-fuse

Using docker engine

  • Docker
  • Docker SDK for Python

Using podman engine

Role Variables

Define a stackable environment hierarchy in multienv_union variable using a list. The last environment in the list has the most priority. For example dev:

multienv_union:
  - base
  - dev

For example dev:

multienv_union:
  - base
  - production

More than two directories can be stacked. For example, to stack stage over dev and base:

multienv_union:
  - base
  - dev
  - stage

For the rest of variables:

Dependencies

  • Centos: if using Centos and getting a message like 'is mounted on / but it is not a shared mount', you may need to make multienv_host_mountpoint a shared mount point with mount --make-rshared <multienv_host_mountpoint>. Replace <multienv_host_mountpoint> with the respective value
  • Depends on other Ansible roles: no

Example Playbook

- hosts: all
  roles:
    - jobcespedes.multienv

Run it with docker:

ansible-playbook -i localhost, multienv.yml

Run it with podman:

# podman method requires sudo
ansible-playbook -i localhost, multienv.yml -e multienv_method=podman -K

Run it with binary in host:

ansible-playbook -i localhost, multienv.yml -e multienv_method=binary

Unmount it

ansible-playbook -i localhost, multienv.yml -e multienv_stop=true

License

Apache 2.0

Author Information

Job Céspedes: [email protected]

multienv's People

Contributors

jobcespedes avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

faheemneuranet

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.