diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst index 065916377..df1737d7a 100644 --- a/doc/source/install/index.rst +++ b/doc/source/install/index.rst @@ -332,7 +332,9 @@ ansible.cfg) or you can specify the location setting .. note:: If you are using a virtual environment ANSIBLE_COLLECTIONS_PATHS is - automatically set. + automatically set. After Ansible Collections are installed, + a symbolic link to to the installation is created in the bifrost playbook + directory. The ``env-setup.sh`` script automatically invokes ``install-deps.sh`` and creates a virtual environment for you: diff --git a/releasenotes/notes/releasenote-4812959d071329fc.yaml b/releasenotes/notes/releasenote-4812959d071329fc.yaml new file mode 100644 index 000000000..59efcd827 --- /dev/null +++ b/releasenotes/notes/releasenote-4812959d071329fc.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + Added creation of a symbolic link from $VENV/collections directory which + contains ansible collections to the playbooks subdirectory of bifrost. + This is done in the env-setup.sh script. +fixes: + - | + The addition of the symbolic link makes bifrost playbooks independent of + the ANSIBLE_COLLECTIONS_PATHS environment variable which wasn't reliably + set in some environments. diff --git a/scripts/env-setup.sh b/scripts/env-setup.sh index 5d765b645..cbfbbcb5c 100755 --- a/scripts/env-setup.sh +++ b/scripts/env-setup.sh @@ -53,6 +53,12 @@ else ${ANSIBLE_GALAXY} collection install -r ${ANSIBLE_COLLECTION_REQ} -p ${BIFROST_COLLECTIONS_PATHS} fi +# Symlink Collections to the playbook directory. This removes the need of setting +# ANSIBLE_COLLECTIONS_PATHS environment variable +if [ ! -e "$(dirname $0)/../playbooks/collections" ]; then + echo "Creating a symbolic link to ansible collections in bifrost playbook directory" + ln -s ${ANSIBLE_COLLECTIONS_PATHS} "$(dirname $0)/../playbooks/collections" +fi echo echo "To use bifrost, do"