File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,33 @@ def known_foreman_plugins(_value):
3131 return compact_list (plugins )
3232
3333
34+ def feature_list (value ):
35+ enabled_list = []
36+ available_list = []
37+ for name , meta in FEATURE_MAP .items ():
38+ if meta .get ('internal' , False ):
39+ continue
40+ description = meta .get ('description' , '' )
41+ if name in value :
42+ enabled_list .append ((name , 'enabled' , description ))
43+ else :
44+ available_list .append ((name , 'available' , description ))
45+
46+ output = [f"{ 'FEATURE' :<25} { 'STATE' :<12} DESCRIPTION" ]
47+ for name , state , description in enabled_list :
48+ output .append (f"{ name :<25} { state :<12} { description } " )
49+ for name , state , description in available_list :
50+ output .append (f"{ name :<25} { state :<12} { description } " )
51+
52+ return "\n " .join (output )
53+
54+
3455class FilterModule (object ):
3556 '''foremanctl filters'''
3657
3758 def filters (self ):
3859 return {
60+ 'feature_list' : feature_list ,
3961 'features_to_foreman_plugins' : foreman_plugins ,
4062 'known_foreman_plugins' : known_foreman_plugins ,
4163 }
Original file line number Diff line number Diff line change 11---
2- - hosts : quadlet
2+ - hosts :
3+ - quadlet
34 gather_facts : false
5+ vars_files :
6+ - " ../../vars/defaults.yml"
7+ - " ../../vars/flavors/{{ flavor }}.yml"
8+ - " ../../vars/base.yaml"
49 tasks :
510 - name : print features
611 ansible.builtin.debug :
7- msg : " Whoa, nice "
12+ msg : " {{ enabled_features | feature_list }} "
You can’t perform that action at this time.
0 commit comments