Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jobcespedes/multienv
A stackable multienvironment directory layout for Ansible using unionfs and docker
https://github.com/jobcespedes/multienv
ansible ansible-role container docker role unionfs
Last synced: 9 days ago
JSON representation
A stackable multienvironment directory layout for Ansible using unionfs and docker
- Host: GitHub
- URL: https://github.com/jobcespedes/multienv
- Owner: jobcespedes
- License: apache-2.0
- Created: 2019-09-23T21:43:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-26T21:14:06.000Z (almost 5 years ago)
- Last Synced: 2024-11-11T09:02:59.483Z (2 months ago)
- Topics: ansible, ansible-role, container, docker, role, unionfs
- Language: Python
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Role Name: multienv
=========[![Build Status](https://travis-ci.org/jobcespedes/multienv.svg?branch=master)](https://travis-ci.org/jobcespedes/multienv) [![Buy me a coffee](https://img.shields.io/badge/$-BuyMeACoffee-blue.svg)](https://www.buymeacoffee.com/jobcespedes)
Description: A stackable multienvironment directory layout for Ansible using unionfs. Check this [Github project](https://github.com/jobcespedes/demo-multienv) 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-fuseUsing docker engine
- Docker
- Docker SDK for PythonUsing podman engine
- Podman- See [`requirements.txt`](requirements.txt)
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**:
```yaml
multienv_union:
- base
- dev
```
For example **dev**:
```yaml
multienv_union:
- base
- production
```
More than two directories can be stacked. For example, to stack **stage** over dev and base:```yaml
multienv_union:
- base
- dev
- stage
```
For the rest of variables:- See [`defaults/main.yml`](defaults/main.yml).
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 ```. Replace `````` with the respective value
- Depends on other Ansible roles: noExample Playbook
----------------```yaml
- hosts: all
roles:
- jobcespedes.multienv
```
Run it with docker:
```bash
ansible-playbook -i localhost, multienv.yml
```Run it with podman:
```bash
# podman method requires sudo
ansible-playbook -i localhost, multienv.yml -e multienv_method=podman -K
```Run it with binary in host:
```bashansible-playbook -i localhost, multienv.yml -e multienv_method=binary
```Unmount it
```bash
ansible-playbook -i localhost, multienv.yml -e multienv_stop=true
```
License
-------Apache 2.0
Author Information
------------------Job Céspedes: [email protected]