]> 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 11:09:42 +0000 (13:09 +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>
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 f0312ebc85bcb91a4c7eb12d8c6f646d8cfb4141..2124856d94e77a2511771a57d7b3e9e2d2d2db37 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_collections
   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 2ece9f2aa87d842bef6333ba292737656a579ed3..6d016fa2f056a0f897bd84bc966638b67f3ab341 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_collections
   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 8e078b48c932f20e1224c2424de0e8166730dbb2..ad26974a4aed95b1e4f76f20d7e16e7e41a27cdf 100644 (file)
@@ -12,8 +12,9 @@ allowlist_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_collections
   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,7 +31,7 @@ setenv=
 deps= -r{toxinidir}/tests/requirements.txt
 changedir={toxinidir}/tests/functional/external_clients{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
   bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
   bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
 
index facea8981feddca8faabeced4ae1c78db0233817..a5af975debde6453c1dd9310c2c455509db38174 100644 (file)
@@ -12,8 +12,9 @@ allowlist_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_collections
   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 2af8c5a1172f5741d301bf1f5058d293d9f6d154..08546d4c9d7503c51d50c9de31c43e69c12f0875 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_collections
   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 cf669c205770a5801eaa1fe80240809999e6080e..d5478362e18f14e6df0927987afee1bf6f0ca9f8 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_collections
   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,7 @@ changedir=
 
 
 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"
 
   bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
index 7e10146e2824f9e063376d2ca58b45b9556e6846..f146f9288a1a54a53cd8ce25b405d737d94c8b7f 100644 (file)
@@ -12,8 +12,9 @@ allowlist_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_collections
   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,7 +36,7 @@ setenv=
 deps= -r{toxinidir}/tests/requirements.txt
 changedir={toxinidir}/tests/functional/subset_update{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
   bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
   bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
 
index 3caec6d573bf45a9c2eb4955df322591a8e1fa0f..cb39b140f841ca6ede7f6ffd652824e4bee17d96 100644 (file)
@@ -12,8 +12,9 @@ allowlist_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_collections
   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,6 +39,8 @@ commands=
   bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
   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
 
 #  # use the stable-7.0 branch to deploy an octopus cluster
@@ -63,7 +66,7 @@ commands=
 
 #  pip uninstall -y ansible
 #  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 "\
       ireallymeanit=yes \
diff --git a/tox.ini b/tox.ini
index 3d746e66ee8e870668b515429637582c99291799..fabcca9977b440accbf9f092f81557a697923370 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -304,10 +304,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}/ansible_collections
   # only available for ansible >= 2.5
   ANSIBLE_STDOUT_CALLBACK = yaml
   non_container: DEV_SETUP = True
@@ -360,7 +361,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"
   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"