File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def available_foreman_plugins(_value):
5555 plugins = [FEATURE_MAP .get (feature ).get ('foreman' , {}).get ('plugin_name' ) for feature in FEATURE_MAP .keys ()]
5656 return compact_list (plugins )
5757
58- def list_all_features (enabled_features ):
58+ def list_all_features (enabled_features , only_enabled = False ):
5959 enabled_list = []
6060 available_list = []
6161 for name , meta in FEATURE_MAP .items ():
@@ -64,7 +64,7 @@ def list_all_features(enabled_features):
6464 description = meta .get ('description' , '' )
6565 if name in enabled_features :
6666 enabled_list .append ((name , 'enabled' , description ))
67- else :
67+ elif not only_enabled :
6868 available_list .append ((name , 'available' , description ))
6969
7070 output = [f"{ 'FEATURE' :<25} { 'STATE' :<12} DESCRIPTION" ]
Original file line number Diff line number Diff line change 44 gather_facts : false
55 tags :
66 - foremanctl_suppress_default_output
7+ vars :
8+ list_enabled : false
79 vars_files :
810 - " ../../vars/defaults.yml"
911 - " ../../vars/flavors/{{ flavor }}.yml"
1012 - " ../../vars/base.yaml"
1113 tasks :
1214 - name : Print features
1315 ansible.builtin.debug :
14- msg : " {{ enabled_features | list_all_features }}"
16+ msg : " {{ enabled_features | list_all_features(list_enabled) }}"
Original file line number Diff line number Diff line change 11---
22help : List all enabled and available features
3+
4+ variables :
5+ list_enabled :
6+ parameter : --list-enabled
7+ help : List only enabled features
8+ action : store_true
9+ persist : false
You can’t perform that action at this time.
0 commit comments