19 lines
665 B
Bash
19 lines
665 B
Bash
|
#!/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!"
|