Skip to content

Commit 57f1a8d

Browse files
committed
ansible_cfg: add callback plugin cli support
To be able to change the Ansible Configuration File callback plugin via cli. Example: make defconfi-* ANSIBLE_CFG_CALLBACK_PLUGIN="debug" Signed-off-by: Daniel Gomez <[email protected]>
1 parent 54164fa commit 57f1a8d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

kconfigs/Kconfig.ansible_cfg

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
config ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI
2+
bool
3+
default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_CALLBACK_PLUGIN)
4+
15
menu "Ansible Callback Plugin Configuration"
26
choice
37
prompt "Ansible Callback Plugin"
4-
default ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE
8+
default ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE if !ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI
9+
default ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM if ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI
510

611
config ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG
712
bool "Ansible Debug Callback Plugin"
@@ -13,13 +18,28 @@ config ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE
1318
help
1419
Dense: https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html
1520

21+
config ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM
22+
bool "Custom Ansible Callback Plugin"
23+
help
24+
This will let you enter in your own Ansible callback plugin
25+
1626
endchoice
1727

28+
if ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM
29+
30+
config ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM_NAME
31+
string "Custom Ansible Callback Plugin Name"
32+
default $(shell, ./scripts/append-makefile-vars.sh $(ANSIBLE_CFG_CALLBACK_PLUGIN)) if ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI
33+
default "dense" if !ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI
34+
35+
endif # ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM
36+
1837
config ANSIBLE_CFG_CALLBACK_PLUGIN_STRING
1938
string
2039
output yaml
2140
default "debug" if ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG
2241
default "dense" if ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE
42+
default ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM_NAME if ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM
2343

2444
config ANSIBLE_CFG_CALLBACK_PLUGIN_CHECK_MODE_MARKERS
2545
bool "check_mode_markers"

0 commit comments

Comments
 (0)