Skip to content

Commit

Permalink
Isolate ANSIBLE_COLLECTIONS_PATH into the venv
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernT committed Oct 18, 2024
1 parent 27de3a9 commit 41afdd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/maas-ansible.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}"
Expand Down
4 changes: 4 additions & 0 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41afdd0

Please sign in to comment.