Skip to content

Introduce a plain foreman flavor - #511

Draft
ekohl wants to merge 4 commits into
theforeman:masterfrom
ekohl:plain-foreman-flavor
Draft

Introduce a plain foreman flavor#511
ekohl wants to merge 4 commits into
theforeman:masterfrom
ekohl:plain-foreman-flavor

Conversation

@ekohl

@ekohl ekohl commented May 15, 2026

Copy link
Copy Markdown
Member

Why are you introducing these changes? (Problem description, related links)

Today Foreman can be deployed without Katello on both RPM and Debian installations and this allows users to mirror that.

What are the changes introduced in this pull request?

The flavor itself is rather trivial, but there are some changes made to only deploy certain roles depending on the features enabled. That is likely incomplete. In particular, Apache is not yet modified to only deploy the required services. In the future when a plain foreman-proxy role is introduced then that will need adjustment.

There are also heavy testing changes, heavily based on #509 which in turn is based on #508. I'm wondering how much of those commits already belong there.

Right now the test suite fails because the foreman feature is only set in the flavor and not in the parameters.

It's also important to look at how this will play into #431.

How to test this pull request

Steps to reproduce:

  • Run foremanctl deploy --flavor foreman
  • Observe only Foreman it deployed without Pulp and Candlepin
  • Test suite passes

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

Comment thread tests/postgresql_test.py Outdated
@arvind4501

Copy link
Copy Markdown
Contributor

Our CI is currently not designed to run flavor specific tests https://github.com/theforeman/foremanctl/blob/master/.github/workflows/test.yml#L54, it adds all features but surely that won't make sense, as we want to only add relevent features for a flavor(ex: add bmc to plain foreman does not make any sense),

Thinking out loud:-
Should we make test workflow per flavor, I am still trying to get all data points which can help in multi-flavor testing

@ekohl

ekohl commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

Should we make test workflow per flavor, I am still trying to get all data points which can help in multi-flavor testing

If you're talking about a GitHub Actions workflow: I think that does make sense. We probably can't test all combinations, but finding a good set is exactly what I think we should do.

@arvind4501

arvind4501 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

If you're talking about a GitHub Actions workflow

yes,and i think without flavor specific workflows we might end up with a single tests workflow which adds all available features(as of today) and will keep CI red

@ekohl

ekohl commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

@ekohl
ekohl force-pushed the plain-foreman-flavor branch from 2c3a344 to ddb679e Compare July 16, 2026 17:11
@ekohl

ekohl commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

The exception is that import_paths and export_paths are unbound in this code:

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')
if os.path.exists(params_file):
with open(params_file, 'r') as f:
params = yaml.safe_load(f)
import_paths = params.get('pulp_import_paths', [])
export_paths = params.get('pulp_export_paths', [])
return import_paths, export_paths

That means the parameters.yaml file doesn't exist.

@ekohl

ekohl commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

That means the parameters.yaml file doesn't exist.

Ah, I moved the file around and it tries to derive the root from the file location.

Also ensures import_paths and export_paths are always defined.
@ekohl
ekohl force-pushed the plain-foreman-flavor branch from ddb679e to 905eb13 Compare July 31, 2026 21:27
import pytest
import yaml

from tests.conftest import PARAMETERS_FILE

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about this, but I see tests/feature/foreman-proxy/base_test.py also imports FOREMAN_PROXY_PORT.

Then there's also this:

@pytest.fixture(scope="module")
def obsah_state_path():
return os.environ.get("OBSAH_STATE", "/var/lib/foremanctl")

Should it be a global fixture?

ekohl added 3 commits July 31, 2026 23:32
This prepares the path for a plain Foreman without Katello.
This allows installing a plain Foreman or plain Foreman Proxy, without
Katello.
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.
@ekohl
ekohl force-pushed the plain-foreman-flavor branch from 905eb13 to b669faa Compare July 31, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants