]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: isolate ansible collections
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 29 Jul 2022 09:15:17 +0000 (11:15 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 3 Aug 2022 17:59:10 +0000 (19:59 +0200)
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>
(cherry picked from commit 50b7a12ad8a3c88794a532ab6db399407ff94f7d)

tox-cephadm.ini
tox-docker2podman.ini
tox-external_clients.ini
tox-filestore_to_bluestore.ini
tox-podman.ini
tox-shrink_osd.ini
tox-subset_update.ini
tox-update.ini
tox.ini

index a58a14f3f1866c8d4742f09451915d50b8693125..e44448fa12f28d63d62018d8613fe9407813b5e9 100644 (file)
@@ -13,8 +13,9 @@ passenv=*
 sitepackages=True
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_KEEP_REMOTE_FILES = 1
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
@@ -27,6 +28,7 @@ deps= -r{toxinidir}/tests/requirements.txt
 changedir= {toxinidir}/tests/functional/cephadm
 
 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/generate_ssh_config.sh {changedir}
 
index b5a6ff5b8572475729753c9b687ec5428b4c691f..33beb55087c073c22d68e841d97e3f17cc91cddc 100644 (file)
@@ -13,8 +13,9 @@ passenv=*
 sitepackages=True
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_KEEP_REMOTE_FILES = 1
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
@@ -27,6 +28,7 @@ deps= -r{toxinidir}/tests/requirements.txt
 changedir= {toxinidir}/tests/functional/docker2podman
 
 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/generate_ssh_config.sh {changedir}
 
index a7cad11d7203ea19d9ef94605ef197b2de466756..5db9ac71ff7f82aaea320d4c5103085b6dd97ef7 100644 (file)
@@ -12,8 +12,9 @@ whitelist_externals =
 passenv=*
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
   # only available for ansible >= 2.5
@@ -30,6 +31,7 @@ setenv=
 deps= -r{toxinidir}/tests/requirements.txt
 changedir={toxinidir}/tests/functional/external_clients{env:CONTAINER_DIR:}
 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/generate_ssh_config.sh {changedir}
 
index cb9cf3b448ae29a21cd4caa3eff61c0722c7d235..dfa3e070a3f76454e404452020488a89680ec0d5 100644 (file)
@@ -12,8 +12,9 @@ whitelist_externals =
 passenv=*
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
   # only available for ansible >= 2.5
@@ -35,6 +36,7 @@ setenv=
 deps= -r{toxinidir}/tests/requirements.txt
 changedir={toxinidir}/tests/functional/filestore-to-bluestore{env:CONTAINER_DIR:}
 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/generate_ssh_config.sh {changedir}
 
index 1c9307a3e39a6a5eb49f1b34e775613f587db33c..ce0020b26870fccc91965ced4624f294b2ff0937 100644 (file)
@@ -13,8 +13,9 @@ passenv=*
 sitepackages=True
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_KEEP_REMOTE_FILES = 1
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
@@ -31,6 +32,7 @@ deps= -r{toxinidir}/tests/requirements.txt
 changedir= {toxinidir}/tests/functional/podman
 
 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/generate_ssh_config.sh {changedir}
 
index fe548d79cac6700ff1b2bfb6160b97850dc1919a..2c55f6ce7c90a17d05c6dbc52c1605b9b1483eb1 100644 (file)
@@ -52,8 +52,9 @@ passenv=*
 sitepackages=False
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_KEEP_REMOTE_FILES = 1
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
@@ -80,6 +81,8 @@ changedir=
 
 
 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/generate_ssh_config.sh {changedir}
 
@@ -114,4 +117,4 @@ commands=
   # retest to ensure OSDs are well redeployed
   py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
 
-  vagrant destroy --force
\ No newline at end of file
+  vagrant destroy --force
index 4e1c06cc94241c2ce7ac0f93119bdf611d728f95..b2e81575e6b7803189ce2cf87d1983efcfa967b1 100644 (file)
@@ -12,8 +12,9 @@ whitelist_externals =
 passenv=*
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
   # only available for ansible >= 2.5
@@ -33,6 +34,7 @@ setenv=
 deps= -r{toxinidir}/tests/requirements.txt
 changedir={toxinidir}/tests/functional/subset_update{env:CONTAINER_DIR:}
 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/generate_ssh_config.sh {changedir}
 
index 94ca977fdbe9e151d17649868a8e8bc7f3be3f8e..5cc7aefddf01d1b3b2b8f0dd50e27b2fc95ace48 100644 (file)
@@ -9,11 +9,13 @@ whitelist_externals =
     bash
     git
     pip
+    rm
 passenv=*
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACK_ENABLED = profile_tasks
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
   # only available for ansible >= 2.5
@@ -38,7 +40,7 @@ commands=
   # use the stable-6.0 branch to deploy an octopus cluster
   git clone -b stable-6.0 --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible
   pip install -r {envdir}/tmp/ceph-ansible/tests/requirements.txt
-  ansible-galaxy install -r {envdir}/tmp/ceph-ansible/requirements.yml -v
+  ansible-galaxy collection install -r {envdir}/tmp/ceph-ansible/requirements.yml -v -p {envdir}/ansible_collections
 
 
   bash -c 'ANSIBLE_CONFIG={envdir}/tmp/ceph-ansible/ansible.cfg ansible-playbook -vv -i {envdir}/tmp/ceph-ansible/tests/functional/all_daemons{env:CONTAINER_DIR:}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml'
@@ -71,8 +73,9 @@ commands=
   "'
 
   pip uninstall -y ansible
+  rm -rf {envdir}/ansible_collections
+  ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
   pip install -r {toxinidir}/tests/requirements.txt
-  ansible-galaxy install -r {toxinidir}/requirements.yml -v -f
   ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\
       ireallymeanit=yes \
       ceph_docker_registry_auth=True \
diff --git a/tox.ini b/tox.ini
index 70d91e71a89a2d6ffb7b377a6c65c6042f81831d..7843f44caf8cf76cfe51a197a00ee1277e6d72c9 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -270,10 +270,11 @@ sitepackages=False
 setenv=
   ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
   ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
-  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CALLBACKS_ENABLED = profile_tasks
   ANSIBLE_KEEP_REMOTE_FILES = 1
   ANSIBLE_CACHE_PLUGIN = memory
   ANSIBLE_GATHERING = implicit
+  ANSIBLE_COLLECTIONS_PATH = {envdir}
   # only available for ansible >= 2.5
   ANSIBLE_STDOUT_CALLBACK = yaml
   non_container: DEV_SETUP = True
@@ -326,7 +327,7 @@ changedir=
   cephadm_adopt: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
 
 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"
 
   bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}