From 5b6b076c4e05b9fb2d7e585fbb1a022ed4f60125 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Mon, 24 Nov 2025 11:04:00 +0000 Subject: [PATCH] ci: Avoid ansible_virtualization_type to check for docker targets It's not consistant across Ansible versions, particular the oldest ones. This may have contributed to older test images containing usernames from the host OS that they were built on (e.g. dmw, alex). --- tests/image_prep/_container_setup.yml | 5 ----- tests/image_prep/_user_accounts.yml | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/image_prep/_container_setup.yml b/tests/image_prep/_container_setup.yml index 93d9a7ce..276004f1 100644 --- a/tests/image_prep/_container_setup.yml +++ b/tests/image_prep/_container_setup.yml @@ -13,11 +13,6 @@ vars: distro: "{{ansible_distribution}}" - pre_tasks: - - meta: end_play - when: - - ansible_virtualization_type != "docker" - roles: - role: package_manager - role: packages diff --git a/tests/image_prep/_user_accounts.yml b/tests/image_prep/_user_accounts.yml index a1701e55..0f167e7a 100644 --- a/tests/image_prep/_user_accounts.yml +++ b/tests/image_prep/_user_accounts.yml @@ -181,6 +181,6 @@ {% endfor %} validate: '/usr/sbin/visudo -cf %s' when: - - ansible_virtualization_type != "docker" + - ansible_connection == "local" roles: - role: user_policies