Compare commits
4 Commits
6afb84b443
...
80c3565fa1
Author | SHA1 | Date | |
---|---|---|---|
80c3565fa1 | |||
fe0fc835cd | |||
ed2fd510a5 | |||
b3e2d1c887 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ playbooks/testing.yml
|
|||||||
*.idea
|
*.idea
|
||||||
**/__pycache__/
|
**/__pycache__/
|
||||||
.venv/
|
.venv/
|
||||||
|
.ansible/
|
||||||
|
8
Makefile
Normal file
8
Makefile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
clean:
|
||||||
|
rm --recursive --force .ansible/
|
||||||
|
|
||||||
|
dev:
|
||||||
|
poetry install --remove-untracked
|
||||||
|
poetry run pre-commit install
|
||||||
|
poetry run ansible-galaxy collection install --requirements-file ./requirements.yaml --collections-path ./.ansible
|
||||||
|
./dynamically-link-local-collections.bash
|
6
ansible
6
ansible
@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ANSIBLE_LIBRARY='' \
|
ANSIBLE_COLLECTIONS_PATH=$(pwd)/.ansible \
|
||||||
ANSIBLE_FILTER_PLUGINS='' \
|
|
||||||
ANSIBLE_CONFIG='' \
|
|
||||||
ANSIBLE_INVENTORY=$(pwd)/inventory.yaml \
|
ANSIBLE_INVENTORY=$(pwd)/inventory.yaml \
|
||||||
"ansible-$1" ${@:2}
|
"ansible-$1" "${@:2}"
|
||||||
|
18
dynamically-link-local-collections.bash
Executable file
18
dynamically-link-local-collections.bash
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
PWD=$(pwd)
|
||||||
|
ANSIBLE_NAMESPACE="skylab"
|
||||||
|
ANSIBLE_COLLECTION_DIR="$PWD/.ansible/ansible_collections"
|
||||||
|
|
||||||
|
mkdir --parents "$ANSIBLE_COLLECTION_DIR/$ANSIBLE_NAMESPACE"
|
||||||
|
|
||||||
|
for collection_path in "$PWD"/"$ANSIBLE_NAMESPACE"/*; do
|
||||||
|
collection=$(basename "$collection_path")
|
||||||
|
if [[ ! -L "$ANSIBLE_COLLECTION_DIR/$ANSIBLE_NAMESPACE/$collection" ]]; then
|
||||||
|
echo "Linking $ANSIBLE_NAMESPACE.$collection into $ANSIBLE_COLLECTION_DIR"
|
||||||
|
rm --recursive --force "${ANSIBLE_COLLECTION_DIR:?}/$ANSIBLE_NAMESPACE/$collection"
|
||||||
|
ln --symbolic "$PWD/$ANSIBLE_NAMESPACE/$collection" "$ANSIBLE_COLLECTION_DIR/$ANSIBLE_NAMESPACE/$collection"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Done!"
|
@ -16,4 +16,5 @@ build_ignore: []
|
|||||||
# collection label 'namespace.name'. The value is a version range
|
# collection label 'namespace.name'. The value is a version range
|
||||||
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
|
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
|
||||||
# range specifiers can be set and are separated by ','
|
# range specifiers can be set and are separated by ','
|
||||||
dependencies: {}
|
dependencies:
|
||||||
|
community.docker: ">=2.0.2,<3.0.0"
|
||||||
|
Reference in New Issue
Block a user