fix(tooling): fixed molecule setup linked to previous path changes

This commit is contained in:
NaeiKinDus 2025-03-09 00:00:00 +00:00
parent a710ec9644
commit 170f972185
Signed by: WoodSmellParticle
GPG key ID: 8E52ADFF7CA8AE56
5 changed files with 16 additions and 13 deletions

View file

@ -10,11 +10,15 @@ includes:
env:
DOCKER_REPOSITORY: pouncetech/molecule
ANSIBLE_VAULT_PASSWORD_FILE: '{{.ROOT_DIR}}/scripts/pass_get_vault_id.sh'
ANSIBLE_LIBRARY:
sh: >
find .venv -name modules -type d -printf "{{.ROOT_DIR}}/%h/%f:" | sed 's/.$//'
vars:
PYTHON_WRAPPER: '{{.ROOT_DIR}}/scripts/python_wrapper.sh'
MOLECULE_DIR: '{{.ROOT_DIR}}/ansible_collections/nullified/infrastructure/extensions'
COLLECTIONS_DIR: '{{.ROOT_DIR}}/ansible_collections'
GALAXY_COLLECTIONS_DIR: '{{.ROOT_DIR}}/galaxy'
ANSIBLE_PASS_PATH: ansible/vault-id
ANSIBLE_PASS_LENGTH: 50
@ -64,6 +68,8 @@ tasks:
desc: execute a molecule command
dir: '{{.MOLECULE_DIR}}'
cmd: '{{.PYTHON_WRAPPER}} molecule {{.CLI_ARGS}}'
env:
ANSIBLE_COLLECTIONS_PATH: '{{.COLLECTIONS_DIR}}:{{.GALAXY_COLLECTIONS_DIR}}'
molecule:purge:
desc: purge libvirtd and reset firewall rules
@ -90,7 +96,7 @@ tasks:
desc: create a new collection
vars:
COLLECTION_NAME: '{{index .MATCH 0}}'
COLLECTION_SUBPATH: 'collections/ansible_collections'
COLLECTION_SUBPATH: 'ansible_collections'
cmds:
- '{{.PYTHON_WRAPPER}} ansible-galaxy collection init {{.COLLECTION_NAME}} --init-path {{.COLLECTIONS_DIR}}'
- 'echo "!{{.COLLECTION_SUBPATH}}/{{(.COLLECTION_NAME | split ".")._0}}" | tee -a .gitignore > /dev/null'