Molecule Ansible Galaxy Wrapper
An Ansible Galaxy wrapper to serve as a molecule dependency plugin with intra-dependencies support.
Motivation
Imagine the scenario, you have a Role named child that depends on a role called parent and parent depends on grandparent.
To install child you need to have parent and grandparent in your roles_path:
child -> parent -> grandparent
Ansible Galaxy is smart enough to figure that out, all you have to do is define grandparent as a dependency of parent role inside meta/main.yml and then parent as a dependency inside child role meta/main.yml file.
The problem is that molecule enforces tracking role dependencies inside a requirements.yml file, in that case, you have two options:
- Include both
parentandchildin yourrequirements.ymland simply ignoremeta/main.yml - Include
parentinsiderequirements.ymland duplicate the same content insidemeta/main.yml
First approach might look reasonable in a scenarion like this, but you might have a more complex dependency relationship and in that case you will soon have big problems.
The latter looks ugly but at least you can delegate the responsability of figuring out the dependency tree to Ansible Galaxy.
Enter the Dirty Hack
At some point we will forget to append dependencies to both requirements.yml and meta/main.yml. To avoid this issue I've created this tiny wrapper that does basically two things:
- Copy the content of
requirements.ymlintometa/main.ymlrequirements list - Run
ansible-galaxy install
Usage
Install molecule-galaxy wrapper:
pip install molecule-galaxy-wrapper
Configure molecule.yml to use the warpper:
dependency:
name: shell
command: galaxywrapper
driver:
name: docker
...
Test it by running:
molecule dependency
Now you can maintain role dependencies inside your requirements.yml file.
Metadata
Release files for molecule-galaxy-wrapper 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| molecule-galaxy-wrapper-0.0.4.tar.gz | 3.6 kB | Without provenance | Details for molecule-galaxy-wrapper-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| molecule_galaxy_wrapper-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for molecule_galaxy_wrapper-0.0.4-py3-none-any.whl |
Total release size: 12.7 kB
Release files / molecule-galaxy-wrapper-0.0.4.tar.gz
| Download URL | molecule-galaxy-wrapper-0.0.4.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b599f51d2d8f8f5e0d92df29373b750d153ad921268d5f933fdfde53610edcd7
|
|
BLAKE2b-256 checksum How to use checksums |
3f26722c119ed18893513840d1c05a877a94d503638899aca597a18f09c2ad5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
|
Release files / molecule_galaxy_wrapper-0.0.4-py3-none-any.whl
| Download URL | molecule_galaxy_wrapper-0.0.4-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca23e51e44a49d3d40e81c73dc8fff5c22a64769541f1c937b571ab555430afa
|
|
BLAKE2b-256 checksum How to use checksums |
9dcf8254b926923315f2c97a1c074e12edb3e026ba631b3f9180be2a7fb4f920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
|
Security for molecule-galaxy-wrapper 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.