From 17b3aa1e32382ebbd90e4ad61bcb5e58e0ec3d1e Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 31 Jul 2026 23:24:13 +0200 Subject: [PATCH 1/4] Reuse PARAMETERS_FILE constant from conftest Also ensures import_paths and export_paths are always defined. --- tests/pulp_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/pulp_test.py b/tests/pulp_test.py index 4f69c2ed4..7db9b5e04 100644 --- a/tests/pulp_test.py +++ b/tests/pulp_test.py @@ -4,17 +4,17 @@ import pytest import yaml +from tests.conftest import PARAMETERS_FILE + PULP_API_SOCKET = '/run/httpd.pulp-api.sock' PULP_CONTENT_SOCKET = '/run/httpd.pulp-content.sock' def load_pulp_paths_from_parameters(): - test_dir = os.path.dirname(os.path.abspath(__file__)) - foremanctl_dir = os.path.dirname(test_dir) - params_file = os.path.join(foremanctl_dir, '.var', 'lib', 'foremanctl', 'parameters.yaml') + import_paths = export_paths = None - if os.path.exists(params_file): - with open(params_file, 'r') as f: + if os.path.exists(PARAMETERS_FILE): + with open(PARAMETERS_FILE, 'r') as f: params = yaml.safe_load(f) import_paths = params.get('pulp_import_paths', []) export_paths = params.get('pulp_export_paths', []) From 028a94682899dc67b5b5084dc1de810796f89934 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 16 Jul 2026 19:09:40 +0200 Subject: [PATCH 2/4] Only deploy candlepin when katello is enabled This prepares the path for a plain Foreman without Katello. --- src/playbooks/deploy/deploy.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index 4e77b6398..dc0fd6897 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -30,7 +30,10 @@ when: - database_mode == 'internal' - valkey - - candlepin + - role: candlepin + when: + - "enabled_features | has_feature('foreman')" + - "enabled_features | has_feature('katello')" - httpd - foreman - pulp From 4ad5901bd45aa7a6fbe2f3fbffdbae640ddf8f21 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 16:18:08 +0200 Subject: [PATCH 3/4] Only deploy Pulp when katello is enabled This allows installing a plain Foreman or plain Foreman Proxy, without Katello. --- src/playbooks/deploy-proxy/deploy-proxy.yaml | 4 +++- src/playbooks/deploy/deploy.yaml | 4 +++- tests/{ => feature/katello}/pulp_test.py | 0 tests/httpd_test.py | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) rename tests/{ => feature/katello}/pulp_test.py (100%) diff --git a/src/playbooks/deploy-proxy/deploy-proxy.yaml b/src/playbooks/deploy-proxy/deploy-proxy.yaml index 5ba00c2a1..0627ce61a 100644 --- a/src/playbooks/deploy-proxy/deploy-proxy.yaml +++ b/src/playbooks/deploy-proxy/deploy-proxy.yaml @@ -31,7 +31,9 @@ - database_mode == 'internal' - valkey - httpd - - pulp + - role: pulp + when: + - "enabled_features | has_feature('katello')" - systemd_target - foreman_proxy - role: post_install diff --git a/src/playbooks/deploy/deploy.yaml b/src/playbooks/deploy/deploy.yaml index dc0fd6897..1e6fae90a 100644 --- a/src/playbooks/deploy/deploy.yaml +++ b/src/playbooks/deploy/deploy.yaml @@ -36,7 +36,9 @@ - "enabled_features | has_feature('katello')" - httpd - foreman - - pulp + - role: pulp + when: + - "enabled_features | has_feature('katello')" - role: systemd_target - role: iop_core when: 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 diff --git a/tests/httpd_test.py b/tests/httpd_test.py index 85cf5011b..6eb8683e3 100644 --- a/tests/httpd_test.py +++ b/tests/httpd_test.py @@ -37,36 +37,42 @@ def test_https_foreman_ping(server, certificates, server_fqdn): 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(curl_request): cmd = curl_request("pulp/api/v3/users/") assert cmd.succeeded assert cmd.stdout == '200' +@pytest.mark.feature('katello') def test_https_pypi_endpoint(curl_request): cmd = curl_request("pypi/test/", return_body=True) assert cmd.succeeded From b669faaff6bc94e893a42e893249d6af149d4b40 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 15 May 2026 14:09:40 +0200 Subject: [PATCH 4/4] 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