tests: isolate ansible collections

When Ansible collections are installed, they should be isolated.
Otherwise, they will be shared in any scheduled job.
This might cause issues when running different branch versions for instance.
This also replace `ANSIBLE_CALLBACK_WHITELIST` with `ANSIBLE_CALLBACK_ENABLED` as it's
going to be deprecated in Ansible 2.15.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/7284/head
Guillaume Abrioux 2022-07-29 11:15:17 +02:00
parent 30c7e88d81
commit 50b7a12ad8
9 changed files with 29 additions and 13 deletions

View File

@ -13,8 +13,9 @@ passenv=*
sitepackages=True sitepackages=True
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_KEEP_REMOTE_FILES = 1 ANSIBLE_KEEP_REMOTE_FILES = 1
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
@ -27,6 +28,7 @@ deps= -r{toxinidir}/tests/requirements.txt
changedir= {toxinidir}/tests/functional/cephadm changedir= {toxinidir}/tests/functional/cephadm
commands= commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

View File

@ -13,8 +13,9 @@ passenv=*
sitepackages=True sitepackages=True
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_KEEP_REMOTE_FILES = 1 ANSIBLE_KEEP_REMOTE_FILES = 1
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
@ -27,6 +28,7 @@ deps= -r{toxinidir}/tests/requirements.txt
changedir= {toxinidir}/tests/functional/docker2podman changedir= {toxinidir}/tests/functional/docker2podman
commands= commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

View File

@ -12,8 +12,9 @@ allowlist_externals =
passenv=* passenv=*
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
# only available for ansible >= 2.5 # only available for ansible >= 2.5
@ -30,7 +31,7 @@ setenv=
deps= -r{toxinidir}/tests/requirements.txt deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/external_clients{env:CONTAINER_DIR:} changedir={toxinidir}/tests/functional/external_clients{env:CONTAINER_DIR:}
commands= commands=
ansible-galaxy install -r {toxinidir}/requirements.yml -v ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

View File

@ -12,8 +12,9 @@ allowlist_externals =
passenv=* passenv=*
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
# only available for ansible >= 2.5 # only available for ansible >= 2.5
@ -35,6 +36,7 @@ setenv=
deps= -r{toxinidir}/tests/requirements.txt deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/filestore-to-bluestore{env:CONTAINER_DIR:} changedir={toxinidir}/tests/functional/filestore-to-bluestore{env:CONTAINER_DIR:}
commands= commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

View File

@ -13,8 +13,9 @@ passenv=*
sitepackages=True sitepackages=True
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_KEEP_REMOTE_FILES = 1 ANSIBLE_KEEP_REMOTE_FILES = 1
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
@ -31,6 +32,7 @@ deps= -r{toxinidir}/tests/requirements.txt
changedir= {toxinidir}/tests/functional/podman changedir= {toxinidir}/tests/functional/podman
commands= commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

View File

@ -52,8 +52,9 @@ passenv=*
sitepackages=False sitepackages=False
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_KEEP_REMOTE_FILES = 1 ANSIBLE_KEEP_REMOTE_FILES = 1
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
@ -80,6 +81,7 @@ changedir=
commands= commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup={env:DEV_SETUP:False} change_dir={changedir} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --tags "vagrant_setup" ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup={env:DEV_SETUP:False} change_dir={changedir} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --tags "vagrant_setup"
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}

View File

@ -12,8 +12,9 @@ allowlist_externals =
passenv=* passenv=*
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
# only available for ansible >= 2.5 # only available for ansible >= 2.5
@ -35,7 +36,7 @@ setenv=
deps= -r{toxinidir}/tests/requirements.txt deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/subset_update{env:CONTAINER_DIR:} changedir={toxinidir}/tests/functional/subset_update{env:CONTAINER_DIR:}
commands= commands=
ansible-galaxy install -r {toxinidir}/requirements.yml -v ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

View File

@ -12,8 +12,9 @@ allowlist_externals =
passenv=* passenv=*
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACK_ENABLED = profile_tasks
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
# only available for ansible >= 2.5 # only available for ansible >= 2.5
@ -38,6 +39,8 @@ commands=
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml
# # use the stable-7.0 branch to deploy an octopus cluster # # use the stable-7.0 branch to deploy an octopus cluster
@ -63,7 +66,7 @@ commands=
# pip uninstall -y ansible # pip uninstall -y ansible
# pip install -r {toxinidir}/tests/requirements.txt # pip install -r {toxinidir}/tests/requirements.txt
ansible-galaxy install -r {toxinidir}/requirements.yml -v # ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\ ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\
ireallymeanit=yes \ ireallymeanit=yes \

View File

@ -304,10 +304,11 @@ sitepackages=False
setenv= setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_CALLBACK_WHITELIST = profile_tasks ANSIBLE_CALLBACKS_ENABLED = profile_tasks
ANSIBLE_KEEP_REMOTE_FILES = 1 ANSIBLE_KEEP_REMOTE_FILES = 1
ANSIBLE_CACHE_PLUGIN = memory ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit ANSIBLE_GATHERING = implicit
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
# only available for ansible >= 2.5 # only available for ansible >= 2.5
ANSIBLE_STDOUT_CALLBACK = yaml ANSIBLE_STDOUT_CALLBACK = yaml
non_container: DEV_SETUP = True non_container: DEV_SETUP = True
@ -360,7 +361,7 @@ changedir=
cephadm_adopt: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:} cephadm_adopt: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
commands= commands=
ansible-galaxy install -r {toxinidir}/requirements.yml -v ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
rhcs: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/rhcs_setup.yml --extra-vars "change_dir={changedir}" --tags "vagrant_setup" rhcs: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/rhcs_setup.yml --extra-vars "change_dir={changedir}" --tags "vagrant_setup"
non_container: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup={env:DEV_SETUP:False} change_dir={changedir} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --tags "vagrant_setup" non_container: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup={env:DEV_SETUP:False} change_dir={changedir} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --tags "vagrant_setup"