Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion foremanctl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ OBSAH_DATA=${OBSAH_BASE}/src
OBSAH_INVENTORY=${OBSAH_BASE}/inventories
OBSAH_STATE=${OBSAH_BASE}/.var/lib/foremanctl
OBSAH_PERSIST_PARAMS=true
OBSAH_ALLOW_EXTRA_VARS=false
# Let downstream wrappers pass extra obsah vars when needed
# (default stays strict; opt-in via OBSAH_ALLOW_EXTRA_VARS=true in env).
OBSAH_ALLOW_EXTRA_VARS=${OBSAH_ALLOW_EXTRA_VARS:-false}
export OBSAH_NAME OBSAH_DATA OBSAH_INVENTORY OBSAH_STATE OBSAH_PERSIST_PARAMS OBSAH_ALLOW_EXTRA_VARS

ANSIBLE_LOG_PATH=${OBSAH_BASE}/.var/lib/foremanctl/foremanctl.log
Expand Down
11 changes: 10 additions & 1 deletion src/filter_plugins/foremanctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@

BASE_FEATURES = ['hammer', 'foreman-proxy', 'foreman']

features_yaml = pathlib.Path(__file__).parent.parent / 'features.yaml'
_SRC_ROOT = pathlib.Path(__file__).parent.parent
features_yaml = _SRC_ROOT / 'features.yaml'
with features_yaml.open() as features_file:
FEATURE_MAP = yaml.safe_load(features_file)

# load additional feature files under features.d
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this goes beyond the "override images" that is also (differently) solved in #501, which I think can be a very valuable addition outside the image context

_features_d = _SRC_ROOT / 'features.d'
if _features_d.is_dir():
for _overlay in sorted(_features_d.glob('*.yaml')):
with _overlay.open() as _overlay_file:
_extra = yaml.safe_load(_overlay_file) or {}
FEATURE_MAP.update(_extra)


def compact_list(items):
return [item for item in items if item is not None]
Expand Down