List enabled and available features#404
Conversation
|
Currently This Does not list the BASE features which are hammer, foreman-proxy, foreman |
|
Is there any to make use of In the results, what does the |
|
Colors can sometimes be a pain, this would enforce colors even if Ansible is configured with no colors. I think we either should skip colors or be consistent with Ansible's configuration. |
I was not much aware about available callback plugins, but now that you mentioned it, i see that there are builtin plugins which i tried and they does not give our expected output format(if i did not missed anything), we might need to create a custom plugin for that but not sure if we should? My thought here was that what if i need a custom script to run at some point from foremanctl and i did not find a way to do so, and that made me do theforeman/obsah#105,
This was taken from https://github.com/theforeman/foremanctl/blob/master/src/filter_plugins/foremanctl.py#L7 , where we define |
I agree, colors should be consistent, thanks |
| STATE_DIR = pathlib.Path(os.environ.get('OBSAH_STATE', '.var/lib/foremanctl')) | ||
|
|
||
|
|
||
| def load_yaml(path: pathlib.Path) -> dict: |
There was a problem hiding this comment.
If the file does not exist, it's a bug; we should raise an error.
Or do we expect it to be missing?
There was a problem hiding this comment.
I think that features.yml must exist as thats where all metadata lives. In
We don't have try and except so i think it can be removed here, i will update that
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| help: | | |||
| List all enabled and available features | |||
There was a problem hiding this comment.
On my completely fresh installation, where I haven't run deploy command yet, the output of the features command is nothing:
dnf install -y foremanctl-1.2.0-1.20260310092525087654.pr404.20.g4464b74.el9.noarch
Last metadata expiration check: 0:02:05 ago on Wed 11 Mar 2026 08:10:46 AM UTC.
Package foremanctl-1.2.0-1.20260310092525087654.pr404.20.g4464b74.el9.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@stream9 vagrant]#
[root@stream9 vagrant]# foremanctl --help
usage: foremanctl [-h] action ...
positional arguments:
action which action to execute
checks Run preflight checks before installing Foreman
deploy Install
features List all enabled and available features
pull-images
Pull necessary container images
optional arguments:
-h, --help show this help message and exit
[root@stream9 vagrant]# foremanctl features
PLAY [List features] ******************************************************************************************
TASK [Gathering Facts] ****************************************************************************************
ok: [localhost]
PLAY RECAP ****************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@stream9 vagrant]#
There was a problem hiding this comment.
thats because you need theforeman/obsah#105 for features to work
| for name in sorted(all_features.keys()): | ||
| meta = all_features[name] or {} | ||
|
|
||
| # Skip internal features |
There was a problem hiding this comment.
Can we have a flag (--show-internals) for the command so I can list internal features as well?
By default, it can be disabled.
This implemets listing of available and enabled features, with old
foreman-installerthere was no good way to list all availabe features then doingforeman-installer --full-helpwhich comes up with lot of puppet module args listed.Here we have
features.ymlas source of truth for features listing. I did not like how ansible playbook outputs directly for listing features(it creates a lot of noise), i want it to be likesystemctlso i have created a PR in obsah which allows bypassing ansible playbook execution and runs scripts directly(a hack to get nice output, maybe can be better).This is how it will show the result
This PR lays out my initial thought of solving features listing.
It requires: PR