A stackable multienvironment directory layout for Ansible using unionfs and docker
172
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.
Using unionfs host binary
Using docker engine
Using podman engine
Podman
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:
defaults/main.yml.multienv_host_mountpoint a shared mount point with mount --make-rshared <multienv_host_mountpoint>. Replace <multienv_host_mountpoint> with the respective value- 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
Apache 2.0
Job Céspedes: [email protected]
Content type
Image
Digest
Size
5.9 MB
Last updated
over 6 years ago
docker pull jobcespedes/multienv