From 2e8e73cce9c57f17911c57d896732f27c58a5703 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 12:50:32 +0200 Subject: [PATCH 01/15] Introduce feature directories in tests This sets up a directory structure where an entire directory gets a feature mark. This makes it easy to skip entire feature tests. --- docs/developer/testing.md | 6 ++++-- tests/conftest.py | 14 ++++++++++++++ tests/feature/__init__.py | 0 tests/{ => feature}/iop/__init__.py | 0 tests/{ => feature}/iop/test_advisor.py | 5 ----- tests/{ => feature}/iop/test_advisor_frontend.py | 5 ----- tests/{ => feature}/iop/test_cvemap_downloader.py | 5 ----- tests/{ => feature}/iop/test_engine.py | 5 ----- tests/{ => feature}/iop/test_gateway.py | 5 ----- tests/{ => feature}/iop/test_ingress.py | 5 ----- tests/{ => feature}/iop/test_integration.py | 5 ----- tests/{ => feature}/iop/test_inventory.py | 5 ----- tests/{ => feature}/iop/test_inventory_frontend.py | 5 ----- tests/{ => feature}/iop/test_kafka.py | 5 ----- tests/{ => feature}/iop/test_puptoo.py | 5 ----- tests/{ => feature}/iop/test_remediation.py | 5 ----- tests/{ => feature}/iop/test_vmaas.py | 5 ----- tests/{ => feature}/iop/test_vulnerability.py | 5 ----- .../iop/test_vulnerability_frontend.py | 5 ----- tests/{ => feature}/iop/test_yuptoo.py | 5 ----- 20 files changed, 18 insertions(+), 82 deletions(-) create mode 100644 tests/feature/__init__.py rename tests/{ => feature}/iop/__init__.py (100%) rename tests/{ => feature}/iop/test_advisor.py (99%) rename tests/{ => feature}/iop/test_advisor_frontend.py (94%) rename tests/{ => feature}/iop/test_cvemap_downloader.py (96%) rename tests/{ => feature}/iop/test_engine.py (95%) rename tests/{ => feature}/iop/test_gateway.py (93%) rename tests/{ => feature}/iop/test_ingress.py (87%) rename tests/{ => feature}/iop/test_integration.py (98%) rename tests/{ => feature}/iop/test_inventory.py (97%) rename tests/{ => feature}/iop/test_inventory_frontend.py (94%) rename tests/{ => feature}/iop/test_kafka.py (97%) rename tests/{ => feature}/iop/test_puptoo.py (71%) rename tests/{ => feature}/iop/test_remediation.py (94%) rename tests/{ => feature}/iop/test_vmaas.py (96%) rename tests/{ => feature}/iop/test_vulnerability.py (99%) rename tests/{ => feature}/iop/test_vulnerability_frontend.py (94%) rename tests/{ => feature}/iop/test_yuptoo.py (71%) diff --git a/docs/developer/testing.md b/docs/developer/testing.md index 22c9122b8..5f1b78a47 100644 --- a/docs/developer/testing.md +++ b/docs/developer/testing.md @@ -225,10 +225,12 @@ def test_dynflow_service_instances(server, instance): ## Where to add new tests +The directory `tests/feature` is special. Any subdirectory automatically applies the feature marker. `tests/feature/foreman/api_test.py` is equivalent to `tests/foreman_api_test.py` with `pytestmark = pytest.mark.feature("foreman")`. + | What you're testing | File | | --- | --- | -| A new service (container or systemd unit) | `tests/_test.py` | -| Foreman API behavior | `tests/foreman_api_test.py` (or a new file for larger areas) | +| A new service (container or systemd unit) | `tests/feature//_test.py` | +| Foreman API behavior | `tests/feature/foreman/api_test.py` (or a new file for larger areas) | | Client registration or content workflows | `tests/client_test.py` | | CLI flags, playbooks, or feature management | `tests/features_test.py` or `tests/playbooks_test.py` | | A standalone script (no deployment needed) | `tests/unit/_test.py` | diff --git a/tests/conftest.py b/tests/conftest.py index 9bf66ec3b..01e63859a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,7 @@ import subprocess import uuid from functools import cached_property +from pathlib import Path import apypie import paramiko @@ -242,6 +243,19 @@ def pytest_configure(config): config.user_parameters = UserParameters(config) +def pytest_collection_modifyitems(config, items): + feature_dir = config.rootdir / 'tests' / 'feature' + for item in items: + try: + rel_path = Path(item.fspath).relative_to(feature_dir) + except ValueError: + # Not in the features directory + pass + else: + feature = rel_path.parts[0] + item.add_marker(pytest.mark.feature(feature)) + + def pytest_runtest_setup(item): feature_markers = set(mark.args[0] for mark in item.iter_markers(name="feature")) if feature_markers: diff --git a/tests/feature/__init__.py b/tests/feature/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/iop/__init__.py b/tests/feature/iop/__init__.py similarity index 100% rename from tests/iop/__init__.py rename to tests/feature/iop/__init__.py diff --git a/tests/iop/test_advisor.py b/tests/feature/iop/test_advisor.py similarity index 99% rename from tests/iop/test_advisor.py rename to tests/feature/iop/test_advisor.py index 06bfa776f..1d0e440bf 100644 --- a/tests/iop/test_advisor.py +++ b/tests/feature/iop/test_advisor.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_advisor_backend_api_service(server): service = server.service("iop-service-advisor-backend-api") assert service.is_running diff --git a/tests/iop/test_advisor_frontend.py b/tests/feature/iop/test_advisor_frontend.py similarity index 94% rename from tests/iop/test_advisor_frontend.py rename to tests/feature/iop/test_advisor_frontend.py index 904b6b82b..c260bbaa4 100644 --- a/tests/iop/test_advisor_frontend.py +++ b/tests/feature/iop/test_advisor_frontend.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_advisor_frontend_assets_directory(server): assets_dir = server.file("/var/www/iop/assets/apps/advisor") assert assets_dir.exists diff --git a/tests/iop/test_cvemap_downloader.py b/tests/feature/iop/test_cvemap_downloader.py similarity index 96% rename from tests/iop/test_cvemap_downloader.py rename to tests/feature/iop/test_cvemap_downloader.py index 5f4fa12f5..d16cd272d 100644 --- a/tests/iop/test_cvemap_downloader.py +++ b/tests/feature/iop/test_cvemap_downloader.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_cvemap_download_script(server): script = server.file("/usr/local/bin/iop-cvemap-download.sh") assert script.exists diff --git a/tests/iop/test_engine.py b/tests/feature/iop/test_engine.py similarity index 95% rename from tests/iop/test_engine.py rename to tests/feature/iop/test_engine.py index c768ab4d2..99f8fd7eb 100644 --- a/tests/iop/test_engine.py +++ b/tests/feature/iop/test_engine.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_engine_service(server): service = server.service("iop-core-engine") assert service.is_running diff --git a/tests/iop/test_gateway.py b/tests/feature/iop/test_gateway.py similarity index 93% rename from tests/iop/test_gateway.py rename to tests/feature/iop/test_gateway.py index c1ca06d82..4fc37d064 100644 --- a/tests/iop/test_gateway.py +++ b/tests/feature/iop/test_gateway.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_gateway_service(server): service = server.service("iop-core-gateway") assert service.is_running diff --git a/tests/iop/test_ingress.py b/tests/feature/iop/test_ingress.py similarity index 87% rename from tests/iop/test_ingress.py rename to tests/feature/iop/test_ingress.py index 84765c688..95c791d76 100644 --- a/tests/iop/test_ingress.py +++ b/tests/feature/iop/test_ingress.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_ingress_service(server): service = server.service("iop-core-ingress") assert service.is_running diff --git a/tests/iop/test_integration.py b/tests/feature/iop/test_integration.py similarity index 98% rename from tests/iop/test_integration.py rename to tests/feature/iop/test_integration.py index 0dd10ac6d..6b096d8cf 100644 --- a/tests/iop/test_integration.py +++ b/tests/feature/iop/test_integration.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_iop_core_kafka_service(server): service = server.service("iop-core-kafka") assert service.is_running diff --git a/tests/iop/test_inventory.py b/tests/feature/iop/test_inventory.py similarity index 97% rename from tests/iop/test_inventory.py rename to tests/feature/iop/test_inventory.py index bf2d1260a..21a2bc28e 100644 --- a/tests/iop/test_inventory.py +++ b/tests/feature/iop/test_inventory.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_inventory_migrate_service(server): service = server.service("iop-core-host-inventory-migrate") assert service.is_enabled diff --git a/tests/iop/test_inventory_frontend.py b/tests/feature/iop/test_inventory_frontend.py similarity index 94% rename from tests/iop/test_inventory_frontend.py rename to tests/feature/iop/test_inventory_frontend.py index 9c16fa34d..5e4a96979 100644 --- a/tests/iop/test_inventory_frontend.py +++ b/tests/feature/iop/test_inventory_frontend.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_inventory_frontend_assets_directory(server): assets_dir = server.file("/var/www/iop/assets/apps/inventory") assert assets_dir.exists diff --git a/tests/iop/test_kafka.py b/tests/feature/iop/test_kafka.py similarity index 97% rename from tests/iop/test_kafka.py rename to tests/feature/iop/test_kafka.py index ff94d930b..b52d76c38 100644 --- a/tests/iop/test_kafka.py +++ b/tests/feature/iop/test_kafka.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_kafka_service(server): service = server.service("iop-core-kafka") assert service.is_running diff --git a/tests/iop/test_puptoo.py b/tests/feature/iop/test_puptoo.py similarity index 71% rename from tests/iop/test_puptoo.py rename to tests/feature/iop/test_puptoo.py index 4dbc9958e..27ce57717 100644 --- a/tests/iop/test_puptoo.py +++ b/tests/feature/iop/test_puptoo.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_puptoo_service(server): service = server.service("iop-core-puptoo") assert service.is_running diff --git a/tests/iop/test_remediation.py b/tests/feature/iop/test_remediation.py similarity index 94% rename from tests/iop/test_remediation.py rename to tests/feature/iop/test_remediation.py index f29a2afdc..202ffb4d0 100644 --- a/tests/iop/test_remediation.py +++ b/tests/feature/iop/test_remediation.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_remediation_api_service(server): service = server.service("iop-service-remediations-api") assert service.is_running diff --git a/tests/iop/test_vmaas.py b/tests/feature/iop/test_vmaas.py similarity index 96% rename from tests/iop/test_vmaas.py rename to tests/feature/iop/test_vmaas.py index e8751b265..225bf9306 100644 --- a/tests/iop/test_vmaas.py +++ b/tests/feature/iop/test_vmaas.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_vmaas_reposcan_service(server): service = server.service("iop-service-vmaas-reposcan") assert service.is_running diff --git a/tests/iop/test_vulnerability.py b/tests/feature/iop/test_vulnerability.py similarity index 99% rename from tests/iop/test_vulnerability.py rename to tests/feature/iop/test_vulnerability.py index dffaa7e40..a409acc17 100644 --- a/tests/iop/test_vulnerability.py +++ b/tests/feature/iop/test_vulnerability.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_vulnerability_manager_service(server): service = server.service("iop-service-vuln-manager") assert service.is_running diff --git a/tests/iop/test_vulnerability_frontend.py b/tests/feature/iop/test_vulnerability_frontend.py similarity index 94% rename from tests/iop/test_vulnerability_frontend.py rename to tests/feature/iop/test_vulnerability_frontend.py index b5c7e910e..8f6172bb7 100644 --- a/tests/iop/test_vulnerability_frontend.py +++ b/tests/feature/iop/test_vulnerability_frontend.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_vulnerability_frontend_assets_directory(server): assets_dir = server.file("/var/www/iop/assets/apps/vulnerability") assert assets_dir.exists diff --git a/tests/iop/test_yuptoo.py b/tests/feature/iop/test_yuptoo.py similarity index 71% rename from tests/iop/test_yuptoo.py rename to tests/feature/iop/test_yuptoo.py index 8af0ed85a..3acc0ace3 100644 --- a/tests/iop/test_yuptoo.py +++ b/tests/feature/iop/test_yuptoo.py @@ -1,8 +1,3 @@ -import pytest - -pytestmark = pytest.mark.feature("iop") - - def test_yuptoo_service(server): service = server.service("iop-core-yuptoo") assert service.is_running From 467b8281d43518314110244c37df766578811544 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 13:11:20 +0200 Subject: [PATCH 02/15] Move foreman, foreman-proxy and hammer feature tests into tests/feature This guards it behind the feature flag, allowing the tests to be skipped if the feature is disabled. For example, on a standalone foreman-proxy. --- tests/feature/foreman-proxy/__init__.py | 0 .../{foreman_proxy_test.py => feature/foreman-proxy/base_test.py} | 0 tests/feature/foreman/__init__.py | 0 tests/{foreman_api_test.py => feature/foreman/api_test.py} | 0 tests/{foreman_test.py => feature/foreman/base_test.py} | 0 .../foreman/compute_resources_test.py} | 0 .../{foreman_plugins_test.py => feature/foreman/plugins_test.py} | 0 tests/feature/hammer/__init__.py | 0 tests/{hammer_test.py => feature/hammer/base_test.py} | 0 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/feature/foreman-proxy/__init__.py rename tests/{foreman_proxy_test.py => feature/foreman-proxy/base_test.py} (100%) create mode 100644 tests/feature/foreman/__init__.py rename tests/{foreman_api_test.py => feature/foreman/api_test.py} (100%) rename tests/{foreman_test.py => feature/foreman/base_test.py} (100%) rename tests/{foreman_compute_resources_test.py => feature/foreman/compute_resources_test.py} (100%) rename tests/{foreman_plugins_test.py => feature/foreman/plugins_test.py} (100%) create mode 100644 tests/feature/hammer/__init__.py rename tests/{hammer_test.py => feature/hammer/base_test.py} (100%) diff --git a/tests/feature/foreman-proxy/__init__.py b/tests/feature/foreman-proxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/foreman_proxy_test.py b/tests/feature/foreman-proxy/base_test.py similarity index 100% rename from tests/foreman_proxy_test.py rename to tests/feature/foreman-proxy/base_test.py diff --git a/tests/feature/foreman/__init__.py b/tests/feature/foreman/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/foreman_api_test.py b/tests/feature/foreman/api_test.py similarity index 100% rename from tests/foreman_api_test.py rename to tests/feature/foreman/api_test.py diff --git a/tests/foreman_test.py b/tests/feature/foreman/base_test.py similarity index 100% rename from tests/foreman_test.py rename to tests/feature/foreman/base_test.py diff --git a/tests/foreman_compute_resources_test.py b/tests/feature/foreman/compute_resources_test.py similarity index 100% rename from tests/foreman_compute_resources_test.py rename to tests/feature/foreman/compute_resources_test.py diff --git a/tests/foreman_plugins_test.py b/tests/feature/foreman/plugins_test.py similarity index 100% rename from tests/foreman_plugins_test.py rename to tests/feature/foreman/plugins_test.py diff --git a/tests/feature/hammer/__init__.py b/tests/feature/hammer/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/hammer_test.py b/tests/feature/hammer/base_test.py similarity index 100% rename from tests/hammer_test.py rename to tests/feature/hammer/base_test.py From 49fd4ecedb1df34612e9647a23b0ed425c9367a7 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 15:24:05 +0200 Subject: [PATCH 03/15] Mark disruptive tests to allow for quicker iteration --- tests/features_test.py | 3 +++ tests/target_lifecycle_test.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tests/features_test.py b/tests/features_test.py index 70cb23935..0fe3c99f2 100644 --- a/tests/features_test.py +++ b/tests/features_test.py @@ -1,5 +1,7 @@ import subprocess +import pytest + def test_foremanctl_features(): command = ['./foremanctl', 'features'] @@ -24,6 +26,7 @@ def test_foremanctl_features_list_enabled(): assert 'available' not in result.stdout +@pytest.mark.disruptive def test_invalid_feature_rejected(): command = ['./foremanctl', 'deploy', '--add-feature', 'invalid-feature'] result = subprocess.run(command, capture_output=True, text=True) diff --git a/tests/target_lifecycle_test.py b/tests/target_lifecycle_test.py index f834ffc97..83cc34df3 100644 --- a/tests/target_lifecycle_test.py +++ b/tests/target_lifecycle_test.py @@ -1,5 +1,7 @@ import time +import pytest + FOREMAN_PING_RETRIES = 60 FOREMAN_PING_DELAY = 10 CURL_CMD = "curl --silent --output /dev/null" @@ -18,6 +20,7 @@ def _wait_for_foreman(server, server_fqdn, certificates): raise AssertionError("Foreman did not become available after target lifecycle operation") +@pytest.mark.disruptive def test_foreman_target_stop_start(server, server_fqdn, certificates): result = server.run("systemctl stop foreman.target") assert result.rc == 0, f"Failed to stop foreman.target: {result.stderr}" @@ -29,6 +32,7 @@ def test_foreman_target_stop_start(server, server_fqdn, certificates): assert server.service("foreman.target").is_running +@pytest.mark.disruptive def test_foreman_target_restart(server, server_fqdn, certificates): result = server.run("systemctl restart foreman.target") assert result.rc == 0, f"Failed to restart foreman.target: {result.stderr}" From 8206be208eb35428d6e68c81132af1609eaf23ec Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 15:34:42 +0200 Subject: [PATCH 04/15] Split off Katello API tests to its own file --- tests/feature/foreman/api_test.py | 49 ----------------------- tests/feature/foreman/katello_api_test.py | 47 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 49 deletions(-) create mode 100644 tests/feature/foreman/katello_api_test.py diff --git a/tests/feature/foreman/api_test.py b/tests/feature/foreman/api_test.py index 4429dbbf3..d0f199151 100644 --- a/tests/feature/foreman/api_test.py +++ b/tests/feature/foreman/api_test.py @@ -2,55 +2,6 @@ def test_foreman_organization(organization): assert organization -def test_foreman_product(product): - assert product - - -def test_foreman_yum_repository(yum_repository, foremanapi, local_request): - assert yum_repository - foremanapi.resource_action('repositories', 'sync', {'id': yum_repository['id']}) - repo_url = yum_repository['full_path'] - assert local_request.get(f'{repo_url}/repodata/repomd.xml', verify=False) - assert local_request.get(f'{repo_url}/Packages/b/bear-4.1-1.noarch.rpm', verify=False) - - -def test_foreman_file_repository(file_repository, foremanapi, local_request): - assert file_repository - foremanapi.resource_action('repositories', 'sync', {'id': file_repository['id']}) - repo_url = file_repository['full_path'] - assert local_request.get(f'{repo_url}/1.iso', verify=False) - - -def test_foreman_container_repository(container_repository, foremanapi): - assert container_repository - foremanapi.resource_action('repositories', 'sync', {'id': container_repository['id']}) - - -def test_foreman_lifecycle_environment(lifecycle_environment): - assert lifecycle_environment - - -def test_foreman_content_view(content_view, yum_repository, foremanapi): - assert content_view - foremanapi.update('content_views', {'id': content_view['id'], 'repository_ids': [yum_repository['id']]}) - foremanapi.resource_action('content_views', 'publish', {'id': content_view['id']}) - # do something with the published view - versions = foremanapi.list('content_view_versions', params={'content_view_id': content_view['id']}) - for version in versions: - current_environment_ids = {environment['id'] for environment in version['environments']} - for environment_id in current_environment_ids: - foremanapi.resource_action('content_views', 'remove_from_environment', params={'id': content_view['id'], 'environment_id': environment_id}) - foremanapi.delete('content_view_versions', version) - - -def test_foreman_manifest(organization, foremanapi, fixture_dir): - manifest_path = fixture_dir / 'manifest.zip' - with open(manifest_path, 'rb') as manifest_file: - files = {'content': (str(manifest_path), manifest_file, 'application/zip')} - params = {'organization_id': organization['id']} - foremanapi.resource_action('subscriptions', 'upload', params, files=files) - - def test_foreman_initial_organization(foremanapi): assert foremanapi.list('organizations', search='name="Foreman CI"') diff --git a/tests/feature/foreman/katello_api_test.py b/tests/feature/foreman/katello_api_test.py new file mode 100644 index 000000000..a721318e6 --- /dev/null +++ b/tests/feature/foreman/katello_api_test.py @@ -0,0 +1,47 @@ +def test_foreman_product(product): + assert product + + +def test_foreman_yum_repository(yum_repository, foremanapi, local_request): + assert yum_repository + foremanapi.resource_action('repositories', 'sync', {'id': yum_repository['id']}) + repo_url = yum_repository['full_path'] + assert local_request.get(f'{repo_url}/repodata/repomd.xml', verify=False) + assert local_request.get(f'{repo_url}/Packages/b/bear-4.1-1.noarch.rpm', verify=False) + + +def test_foreman_file_repository(file_repository, foremanapi, local_request): + assert file_repository + foremanapi.resource_action('repositories', 'sync', {'id': file_repository['id']}) + repo_url = file_repository['full_path'] + assert local_request.get(f'{repo_url}/1.iso', verify=False) + + +def test_foreman_container_repository(container_repository, foremanapi): + assert container_repository + foremanapi.resource_action('repositories', 'sync', {'id': container_repository['id']}) + + +def test_foreman_lifecycle_environment(lifecycle_environment): + assert lifecycle_environment + + +def test_foreman_content_view(content_view, yum_repository, foremanapi): + assert content_view + foremanapi.update('content_views', {'id': content_view['id'], 'repository_ids': [yum_repository['id']]}) + foremanapi.resource_action('content_views', 'publish', {'id': content_view['id']}) + # do something with the published view + versions = foremanapi.list('content_view_versions', params={'content_view_id': content_view['id']}) + for version in versions: + current_environment_ids = {environment['id'] for environment in version['environments']} + for environment_id in current_environment_ids: + foremanapi.resource_action('content_views', 'remove_from_environment', params={'id': content_view['id'], 'environment_id': environment_id}) + foremanapi.delete('content_view_versions', version) + + +def test_foreman_manifest(organization, foremanapi, fixture_dir): + manifest_path = fixture_dir / 'manifest.zip' + with open(manifest_path, 'rb') as manifest_file: + files = {'content': (str(manifest_path), manifest_file, 'application/zip')} + params = {'organization_id': organization['id']} + foremanapi.resource_action('subscriptions', 'upload', params, files=files) From 49bfbcac0f55d414124902374372763220628997 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 16:13:41 +0200 Subject: [PATCH 05/15] Only test for azure-rm and google features when enabled --- .../feature/foreman/compute_resources_test.py | 22 ++++++++++++++++--- tests/feature/foreman/plugins_test.py | 17 ++++++++++---- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/tests/feature/foreman/compute_resources_test.py b/tests/feature/foreman/compute_resources_test.py index 6ed61b1de..8e47bcb1f 100644 --- a/tests/feature/foreman/compute_resources_test.py +++ b/tests/feature/foreman/compute_resources_test.py @@ -1,9 +1,25 @@ import pytest -@pytest.mark.parametrize("compute_resource", ['AzureRm', 'EC2', 'GCE', 'Libvirt', 'Openstack', 'Vmware']) -def test_foreman_compute_resources(foremanapi, compute_resource): +# TODO: Foreman really should have a dedicated API endpoint to expose this info +@pytest.fixture +def provider_description(foremanapi): create = foremanapi.resource('compute_resources').action('create') compute_resource_param = [param for param in create.params if param.name == 'compute_resource'][0] provider = [param for param in compute_resource_param.params if param.name == 'provider'][0] - assert compute_resource in provider.description + return provider.description + + +@pytest.mark.parametrize("compute_resource", ['EC2', 'Libvirt', 'Openstack', 'Vmware']) +def test_foreman_compute_resources_built_in(provider_description, compute_resource): + assert compute_resource in provider_description + + +@pytest.mark.feature('azure-rm') +def test_foreman_compute_resources_azure_rm(provider_description): + assert 'AzureRm' in provider_description + + +@pytest.mark.feature('google') +def test_foreman_compute_resources_google(provider_description): + assert 'GCE' in provider_description diff --git a/tests/feature/foreman/plugins_test.py b/tests/feature/foreman/plugins_test.py index b2c787ccb..d6c4c2d32 100644 --- a/tests/feature/foreman/plugins_test.py +++ b/tests/feature/foreman/plugins_test.py @@ -1,7 +1,16 @@ import pytest -@pytest.mark.parametrize("foreman_plugin", ['foreman_azure_rm', 'foreman_google']) -def test_foreman_compute_resources(foremanapi, foreman_plugin): - plugins = [plugin['name'] for plugin in foremanapi.list('plugins')] - assert foreman_plugin in plugins +@pytest.fixture +def foreman_plugins(foremanapi): + return [plugin['name'] for plugin in foremanapi.list('plugins')] + + +@pytest.mark.feature('azure-rm') +def test_foreman_compute_resources_azure_rm(foreman_plugins): + assert 'foreman_azure_rm' in foreman_plugins + + +@pytest.mark.feature('google') +def test_foreman_compute_resources_google(foreman_plugins): + assert 'foreman_google' in foreman_plugins From 6c0f74e3fd0196ba44feee0c97dfa787377ef0ac Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 16:16:17 +0200 Subject: [PATCH 06/15] Move katello client specific tests to katello directory --- tests/feature/katello/__init__.py | 0 tests/{ => feature/katello}/client_test.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/feature/katello/__init__.py rename tests/{ => feature/katello}/client_test.py (100%) diff --git a/tests/feature/katello/__init__.py b/tests/feature/katello/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/client_test.py b/tests/feature/katello/client_test.py similarity index 100% rename from tests/client_test.py rename to tests/feature/katello/client_test.py From 851c624969b838902b3353c68135164af47ca4e9 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 16:17:46 +0200 Subject: [PATCH 07/15] Mark tests with the appropriate feature --- tests/feature/foreman/base_test.py | 1 + tests/feature/foreman/katello_api_test.py | 5 +++++ tests/httpd_test.py | 12 ++++++++++++ 3 files changed, 18 insertions(+) diff --git a/tests/feature/foreman/base_test.py b/tests/feature/foreman/base_test.py index 174dd1f66..aa1d74ac3 100644 --- a/tests/feature/foreman/base_test.py +++ b/tests/feature/foreman/base_test.py @@ -47,6 +47,7 @@ def test_foreman_status_cache(foreman_status): assert foreman_status['results']['foreman']['cache']['servers'][0]['status'] == 'ok' +@pytest.mark.feature('katello') @pytest.mark.parametrize("katello_service", ['candlepin', 'candlepin_auth', 'foreman_tasks', 'katello_events', 'pulp3', 'pulp3_content']) def test_katello_services_status(foreman_status, katello_service): assert foreman_status['results']['katello']['services'][katello_service]['status'] == 'ok' diff --git a/tests/feature/foreman/katello_api_test.py b/tests/feature/foreman/katello_api_test.py index a721318e6..57cd2ce1b 100644 --- a/tests/feature/foreman/katello_api_test.py +++ b/tests/feature/foreman/katello_api_test.py @@ -1,3 +1,8 @@ +import pytest + +pytestmark = pytest.mark.feature('katello') + + def test_foreman_product(product): assert product diff --git a/tests/httpd_test.py b/tests/httpd_test.py index fe07d2d4d..796939ac5 100644 --- a/tests/httpd_test.py +++ b/tests/httpd_test.py @@ -1,3 +1,5 @@ +import pytest + HTTP_HOST = 'localhost' HTTP_PORT = 80 HTTPS_PORT = 443 @@ -21,48 +23,56 @@ def test_https_port(server): assert httpd.port(HTTPS_PORT).is_reachable +@pytest.mark.feature("foreman") def test_http_foreman_ping(server, server_fqdn): cmd = server.run(f"{CURL_CMD} --write-out '%{{redirect_url}}' http://{server_fqdn}/api/v2/ping") assert cmd.succeeded assert cmd.stdout == f'https://{server_fqdn}/api/v2/ping' +@pytest.mark.feature("foreman") def test_https_foreman_ping(server, certificates, server_fqdn): cmd = server.run(f"{CURL_CMD} --cacert {certificates['server_ca_certificate']} --write-out '%{{http_code}}' https://{server_fqdn}/api/v2/ping") assert cmd.succeeded assert cmd.stdout == '200' +@pytest.mark.feature("katello") def test_http_pulp_api_status(server, server_fqdn): cmd = server.run(f"{CURL_CMD} --write-out '%{{http_code}}' http://{server_fqdn}/pulp/api/v3/status/") assert cmd.succeeded assert cmd.stdout == '404' +@pytest.mark.feature("katello") def test_https_pulp_api_status(server, certificates, server_fqdn): cmd = server.run(f"{CURL_CMD} --cacert {certificates['server_ca_certificate']} --write-out '%{{http_code}}' https://{server_fqdn}/pulp/api/v3/status/") assert cmd.succeeded assert cmd.stdout == '200' +@pytest.mark.feature("katello") def test_http_pulp_content(server, server_fqdn): cmd = server.run(f"{CURL_CMD} --write-out '%{{stderr}}%{{http_code}}' http://{server_fqdn}/pulp/content/") assert cmd.succeeded assert cmd.stderr == '200' +@pytest.mark.feature("katello") def test_https_pulp_content(server, certificates, server_fqdn): cmd = server.run(f"curl --silent --cacert {certificates['server_ca_certificate']} https://{server_fqdn}/pulp/content/") assert cmd.succeeded assert "Index of /pulp/content/" in cmd.stdout +@pytest.mark.feature("katello") def test_https_pulp_auth(server, certificates, server_fqdn): cmd = server.run(f"{CURL_CMD} --cacert {certificates['server_ca_certificate']} --write-out '%{{http_code}}' --cert {certificates['client_certificate']} --key {certificates['client_key']} https://{server_fqdn}/pulp/api/v3/users/") assert cmd.succeeded assert cmd.stdout == '200' +@pytest.mark.feature("katello") def test_https_pypi_endpoint(server, certificates, server_fqdn): cmd = server.run(f"curl --cacert {certificates['server_ca_certificate']} https://{server_fqdn}/pypi/test/") assert cmd.succeeded @@ -102,12 +112,14 @@ def test_https_pub_server_ca_certificate_downloadable(server, certificates, serv assert cmd.stdout == '200' +@pytest.mark.feature("foreman") def test_http_foreman_login(server, server_fqdn): cmd = server.run(f"{CURL_CMD} --write-out '%{{http_code}}' http://{server_fqdn}/users/login") assert cmd.succeeded assert cmd.stdout == '301' +@pytest.mark.feature("foreman") def test_https_foreman_login(server, certificates, server_fqdn): cmd = server.run(f"{CURL_CMD} --cacert {certificates['server_ca_certificate']} --write-out '%{{http_code}}' https://{server_fqdn}/users/login") assert cmd.succeeded From fcb4d6dd2868c666c6b9a41b5a661cb93b1ebb4f Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 16:18:08 +0200 Subject: [PATCH 08/15] Only deploy Candlepin and Pulp when needed --- src/playbooks/deploy/deploy.yaml | 9 +++++++-- src/roles/foreman/tasks/main.yaml | 2 ++ tests/{ => feature/katello}/candlepin_test.py | 5 +++++ tests/{ => feature/katello}/pulp_test.py | 0 4 files changed, 14 insertions(+), 2 deletions(-) rename tests/{ => feature/katello}/candlepin_test.py (95%) rename tests/{ => feature/katello}/pulp_test.py (100%) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index 837d36c98..8020310e0 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -40,9 +40,14 @@ when: - database_mode == 'internal' - redis - - candlepin + - role: candlepin + when: + - "'foreman' in enabled_features" + - "'katello' in enabled_features" - httpd - - pulp + - role: pulp + when: + - "'katello' in enabled_features" - foreman - role: systemd_target - role: iop_core diff --git a/src/roles/foreman/tasks/main.yaml b/src/roles/foreman/tasks/main.yaml index f08ac17f9..0105171b5 100644 --- a/src/roles/foreman/tasks/main.yaml +++ b/src/roles/foreman/tasks/main.yaml @@ -313,3 +313,5 @@ oauth1_consumer_key: "{{ foreman_oauth_consumer_key }}" oauth1_consumer_secret: "{{ foreman_oauth_consumer_secret }}" ca_path: "{{ foreman_ca_certificate }}" + when: + - "'katello' in enabled_features" diff --git a/tests/candlepin_test.py b/tests/feature/katello/candlepin_test.py similarity index 95% rename from tests/candlepin_test.py rename to tests/feature/katello/candlepin_test.py index bfdf731c8..ae81bb5b7 100644 --- a/tests/candlepin_test.py +++ b/tests/feature/katello/candlepin_test.py @@ -1,3 +1,8 @@ +import pytest + +pytestmark = pytest.mark.feature("foreman") + + def assert_secret_content(server, secret_name, secret_value): secret = server.run(f'podman secret inspect --format {"{{.SecretData}}"} --showsecret {secret_name}') assert secret.succeeded diff --git a/tests/pulp_test.py b/tests/feature/katello/pulp_test.py similarity index 100% rename from tests/pulp_test.py rename to tests/feature/katello/pulp_test.py From 03c8e8daeca036a2e197e2e2f2b0e13db0407ac7 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 16:11:43 +0200 Subject: [PATCH 09/15] Only deploy databases for the requested features --- src/playbooks/deploy/deploy.yaml | 41 +++++++++++++++++++++++++------- src/vars/database.yml | 16 +++++++++++-- tests/conftest.py | 4 ++++ tests/postgresql_test.py | 36 +++++++++++++++++++++------- 4 files changed, 79 insertions(+), 18 deletions(-) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index 8020310e0..58c99a033 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -13,19 +13,44 @@ - "../../vars/foreman.yml" - "../../vars/base.yaml" pre_tasks: - - name: Add iop databases + - name: Determine databases when: - - "'iop' in enabled_features" - database_mode == 'internal' block: - - name: Include iop databases - ansible.builtin.include_vars: - file: "../../vars/database_iop.yml" + - name: Configure Candlepin database + ansible.builtin.set_fact: + postgresql_databases: "{{ postgresql_databases + postgresql_databases_candlepin }}" + postgresql_users: "{{ postgresql_users + postgresql_users_candlepin }}" + when: + - "'foreman' in enabled_features" + - "'katello' in enabled_features" + + - name: Configure Foreman database + ansible.builtin.set_fact: + postgresql_databases: "{{ postgresql_databases + postgresql_databases_foreman }}" + postgresql_users: "{{ postgresql_users + postgresql_users_foreman }}" + when: + - "'foreman' in enabled_features" - - name: Combine lists + - name: Configure Pulp database ansible.builtin.set_fact: - postgresql_databases: "{{ postgresql_databases + iop_postgresql_databases }}" - postgresql_users: "{{ postgresql_users + iop_postgresql_users }}" + postgresql_databases: "{{ postgresql_databases + postgresql_databases_pulp }}" + postgresql_users: "{{ postgresql_users + postgresql_users_pulp }}" + when: + - "'katello' in enabled_features" + + - name: Add iop databases + when: + - "'iop' in enabled_features" + block: + - name: Include iop databases + ansible.builtin.include_vars: + file: "../../vars/database_iop.yml" + + - name: Combine lists + ansible.builtin.set_fact: + postgresql_databases: "{{ postgresql_databases + iop_postgresql_databases }}" + postgresql_users: "{{ postgresql_users + iop_postgresql_users }}" roles: - role: pre_install - role: checks diff --git a/src/vars/database.yml b/src/vars/database.yml index 2a89bed01..3d0d2d8fb 100644 --- a/src/vars/database.yml +++ b/src/vars/database.yml @@ -29,17 +29,29 @@ foreman_database_port: "{{ database_port }}" foreman_database_ssl_mode: "{{ database_ssl_mode }}" foreman_database_ssl_ca: "{{ database_ssl_ca }}" -postgresql_databases: +postgresql_databases_candlepin: - name: "{{ candlepin_database_name }}" owner: "{{ candlepin_database_user }}" + +postgresql_databases_foreman: - name: "{{ foreman_database_name }}" owner: "{{ foreman_database_user }}" + +postgresql_databases_pulp: - name: "{{ pulp_database_name }}" owner: "{{ pulp_database_user }}" -postgresql_users: + +postgresql_users_candlepin: - name: "{{ candlepin_database_user }}" password: "{{ candlepin_database_password }}" + +postgresql_users_foreman: - name: "{{ foreman_database_user }}" password: "{{ foreman_database_password }}" + +postgresql_users_pulp: - name: "{{ pulp_database_user }}" password: "{{ pulp_database_password }}" + +postgresql_databases: [] +postgresql_users: [] diff --git a/tests/conftest.py b/tests/conftest.py index 01e63859a..15ea07ebf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -145,6 +145,10 @@ def foremanapi(ssh_config, server_fqdn): api._session.headers['Host'] = server_fqdn return api +@pytest.fixture +def features(pytestconfig): + return pytestconfig.user_parameters.features + @pytest.fixture def organization(foremanapi): diff --git a/tests/postgresql_test.py b/tests/postgresql_test.py index 82187466a..42fdaa7c8 100644 --- a/tests/postgresql_test.py +++ b/tests/postgresql_test.py @@ -13,18 +13,38 @@ def test_postgresql_port(database): assert postgresql.port("5432").is_reachable -def test_postgresql_databases(database): +def test_postgresql_databases(features, database): result = database.run("podman exec postgresql psql -U postgres -c '\\l'") - assert "foreman" in result.stdout - assert "candlepin" in result.stdout - assert "pulp" in result.stdout + + if "foreman" in features: + assert "foreman" in result.stdout + else: + assert "foreman" not in result.stdout + + if "katello" in features: + if "foreman" in features: + assert "candlepin" in result.stdout + assert "pulp" in result.stdout + else: + assert "candlepin" not in result.stdout + assert "pulp" not in result.stdout -def test_postgresql_users(database): +def test_postgresql_users(features, database): result = database.run("podman exec postgresql psql -U postgres -c '\\du'") - assert "foreman" in result.stdout - assert "candlepin" in result.stdout - assert "pulp" in result.stdout + + if "foreman" in features: + assert "foreman" in result.stdout + else: + assert "foreman" not in result.stdout + + if "katello" in features: + if "foreman" in features: + assert "candlepin" in result.stdout + assert "pulp" in result.stdout + else: + assert "candlepin" not in result.stdout + assert "pulp" not in result.stdout def test_postgresql_password_encryption(database): From 6aad15c5fca9ce2392fb8d898eb75f9e57c11960 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 14:09:40 +0200 Subject: [PATCH 10/15] Introduce a plain Foreman flavor This moves Candlepin and Pulp behind the feature flags. Candlepin is only deployed on Foreman with Katello servers while Pulp is deployed on Katello enabled servers. --- src/vars/flavors/foreman.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/vars/flavors/foreman.yml diff --git a/src/vars/flavors/foreman.yml b/src/vars/flavors/foreman.yml new file mode 100644 index 000000000..ac29b9597 --- /dev/null +++ b/src/vars/flavors/foreman.yml @@ -0,0 +1,3 @@ +--- +flavor_features: + - foreman From 50ac5a58b2692248453537c9d00a15a4ef04fa56 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 20:46:23 +0200 Subject: [PATCH 11/15] Introduce httpd and redis internal features This makes it easier to exclude them from tests. --- src/features.yaml | 10 ++++++++++ src/playbooks/deploy/deploy.yaml | 8 ++++++-- tests/feature/httpd/__init__.py | 0 tests/{httpd_test.py => feature/httpd/base_test.py} | 0 tests/feature/redis/__init__.py | 0 tests/{redis_test.py => feature/redis/base_test.py} | 0 6 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/feature/httpd/__init__.py rename tests/{httpd_test.py => feature/httpd/base_test.py} (100%) create mode 100644 tests/feature/redis/__init__.py rename tests/{redis_test.py => feature/redis/base_test.py} (100%) diff --git a/src/features.yaml b/src/features.yaml index f8284b019..14d436cea 100644 --- a/src/features.yaml +++ b/src/features.yaml @@ -1,15 +1,25 @@ --- foreman: description: Base Foreman Server + dependencies: + - httpd + - redis foreman-proxy: description: Base Foreman Proxy hammer: description: Foreman CLI +httpd: + internal: true +redis: + internal: true katello: description: Content and Subscription Management plugin for Foreman foreman: plugin_name: katello hammer: katello + dependencies: + - httpd + - redis google: description: Google Compute Engine plugin for Foreman hammer: foreman_google diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index 58c99a033..ae800f9d1 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -64,12 +64,16 @@ - role: postgresql when: - database_mode == 'internal' - - redis + - role: redis + when: + - "'redis' in enabled_features" - role: candlepin when: - "'foreman' in enabled_features" - "'katello' in enabled_features" - - httpd + - role: httpd + when: + - "'httpd' in enabled_features" - role: pulp when: - "'katello' in enabled_features" diff --git a/tests/feature/httpd/__init__.py b/tests/feature/httpd/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/httpd_test.py b/tests/feature/httpd/base_test.py similarity index 100% rename from tests/httpd_test.py rename to tests/feature/httpd/base_test.py diff --git a/tests/feature/redis/__init__.py b/tests/feature/redis/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/redis_test.py b/tests/feature/redis/base_test.py similarity index 100% rename from tests/redis_test.py rename to tests/feature/redis/base_test.py From 524bf9c60e23937c73a838be59d415db71801dc6 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 20:55:12 +0200 Subject: [PATCH 12/15] Make foreman more optional --- src/playbooks/deploy/deploy.yaml | 4 +++- src/roles/post_install/tasks/main.yaml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index ae800f9d1..9364d1bba 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -77,7 +77,9 @@ - role: pulp when: - "'katello' in enabled_features" - - foreman + - role: foreman + when: + - "'foreman' in enabled_features" - role: systemd_target - role: iop_core when: diff --git a/src/roles/post_install/tasks/main.yaml b/src/roles/post_install/tasks/main.yaml index 6327e77ac..da5362ff6 100644 --- a/src/roles/post_install/tasks/main.yaml +++ b/src/roles/post_install/tasks/main.yaml @@ -7,6 +7,8 @@ vars: _post_install_url_msg: "Foreman is running at {{ foreman_url }}" _post_install_cred_msg: "Admin credentials: {{ foreman_initial_admin_username }}:{{ foreman_initial_admin_password }}" + when: + - "'foreman' in enabled_features" - name: Mark installation as complete ansible.builtin.copy: dest: "{{ post_install_done_flag }}" From 12c8acbec23ba18a52718eb3975ee94af5cbdf2e Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 20:56:12 +0200 Subject: [PATCH 13/15] [INCOMPLETE] Only deploy postgresql if required The tests still run which needs to be addressed. --- src/playbooks/deploy/deploy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index 9364d1bba..8e65c4571 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -64,6 +64,7 @@ - role: postgresql when: - database_mode == 'internal' + - postgresql_databases | length > 0 - role: redis when: - "'redis' in enabled_features" From e0722a49e893f90e255251ce4edc660e5d445a0e Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 20:56:58 +0200 Subject: [PATCH 14/15] Correctly assert foreman-proxy features --- tests/feature/foreman-proxy/base_test.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/feature/foreman-proxy/base_test.py b/tests/feature/foreman-proxy/base_test.py index 71ad8cbc0..5e0427dc7 100644 --- a/tests/feature/foreman-proxy/base_test.py +++ b/tests/feature/foreman-proxy/base_test.py @@ -23,8 +23,17 @@ def test_foreman_proxy_features(server, certificates, server_fqdn, enabled_featu assert cmd.succeeded features = json.loads(cmd.stdout) assert "logs" in features - assert "script" in features - assert "dynflow" in features + + if "remote-execution" in enabled_features: + assert "script" in features + else: + assert "script" not in features + + if "dynflow" in enabled_features: + assert "dynflow" in features + else: + assert "dynflow" not in features + if 'bmc' in enabled_features: assert "bmc" in features else: From 3203ccf6e22db40d878e73106b17d506ccd336cb Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 20:59:22 +0200 Subject: [PATCH 15/15] [INCOMPLETE] Introduce plain foreman-proxy feature --- src/roles/foreman_proxy/tasks/main.yaml | 2 ++ src/vars/flavors/foreman-proxy.yml | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 src/vars/flavors/foreman-proxy.yml diff --git a/src/roles/foreman_proxy/tasks/main.yaml b/src/roles/foreman_proxy/tasks/main.yaml index fa36f7f26..f129a3884 100644 --- a/src/roles/foreman_proxy/tasks/main.yaml +++ b/src/roles/foreman_proxy/tasks/main.yaml @@ -78,6 +78,8 @@ oauth1_consumer_key: "{{ foreman_proxy_oauth_consumer_key }}" oauth1_consumer_secret: "{{ foreman_proxy_oauth_consumer_secret }}" ca_path: "{{ foreman_proxy_foreman_ca_certificate | default(omit) }}" + when: + - False - name: Flush handlers to restart services ansible.builtin.meta: flush_handlers diff --git a/src/vars/flavors/foreman-proxy.yml b/src/vars/flavors/foreman-proxy.yml new file mode 100644 index 000000000..43cdc05ba --- /dev/null +++ b/src/vars/flavors/foreman-proxy.yml @@ -0,0 +1,3 @@ +--- +flavor_features: + - foreman-proxy