From 41afdd0f320cc13fdfae7efde789d03a8f3f3bc8 Mon Sep 17 00:00:00 2001 From: Bjoern Teipel Date: Fri, 18 Oct 2024 15:57:53 -0500 Subject: [PATCH] Isolate ANSIBLE_COLLECTIONS_PATH into the venv --- scripts/maas-ansible.rc | 5 ++++- scripts/prepare.sh | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/maas-ansible.rc b/scripts/maas-ansible.rc index 1a544f86..48bbef0e 100644 --- a/scripts/maas-ansible.rc +++ b/scripts/maas-ansible.rc @@ -18,7 +18,7 @@ export OSA_CONFIG_DIR="${OSA_CONFIG_DIR:-/etc/openstack_deploy}" export ANSIBLE_RETRY_FILES_ENABLED="${ANSIBLE_RETRY_FILES_ENABLED:-False}" export ANSIBLE_INVENTORY="${ANSIBLE_INVENTORY:-/opt/openstack-ansible/inventory/dynamic_inventory.py,/opt/openstack-ansible/inventory/inventory.ini,${OSA_CONFIG_DIR}/inventory.ini}" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_PATH:-/openstack/log/ansible-logging/ansible.log}" +export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_PATH:-/opt/rpc-maas/maas-ansible.log}" mkdir -p "$(dirname ${ANSIBLE_LOG_PATH})" || unset ANSIBLE_LOG_PATH export ANSIBLE_PYTHON_INTERPRETER="auto_legacy" @@ -36,6 +36,9 @@ if [[ "${ANSIBLE_CACHE_PLUGIN}" == "memcached" ]];then fi fi +export ANSIBLE_COLLECTIONS_PATHS="${ANSIBLE_COLLECTIONS_PATHS:-/root/ansible_venv/}" +export ANSIBLE_COLLECTIONS_PATH="${ANSIBLE_COLLECTIONS_PATH:-/root/ansible_venv/}" + export ANSIBLE_HOST_KEY_CHECKING="${ANSIBLE_HOST_KEY_CHECKING:-False}" export ANSIBLE_TIMEOUT="${ANSIBLE_TIMEOUT:-5}" export ANSIBLE_SSH_PIPELINING="${ANSIBLE_SSH_PIPELINING:-True}" diff --git a/scripts/prepare.sh b/scripts/prepare.sh index 77e55cc2..637ea09c 100755 --- a/scripts/prepare.sh +++ b/scripts/prepare.sh @@ -34,6 +34,10 @@ fi # Install required packages . /root/ansible_venv/bin/activate + +export ANSIBLE_COLLECTIONS_PATHS="${ANSIBLE_COLLECTIONS_PATHS:-/root/ansible_venv/}" +export ANSIBLE_COLLECTIONS_PATH="${ANSIBLE_COLLECTIONS_PATH:-/root/ansible_venv/}" + pip install -r /opt/rpc-maas/requirements.txt ansible-galaxy collection install community.rabbitmq