【问题标题】:want to hide "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" } from ping module output?想从 ping 模块输出中隐藏 "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" }?
【发布时间】:2020-05-31 03:57:35
【问题描述】:
我想在 ping 模块的输出中隐藏"ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3"}。
【问题讨论】:
标签:
python
configuration
ansible
ansible-facts
【解决方案1】:
可以配置DEFAULT_STDOUT_CALLBACK 和" Set the main callback used to display Ansible output."。例如
$ cat playbook.yml
- hosts: test_01
tasks:
- ping:
$ export ANSIBLE_STDOUT_CALLBACK=actionable; ansible-playbook playbook.yml
PLAY [test_01] ***
PLAY RECAP ***
test_01: ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
查看其他可用的callback plugins。
【解决方案2】:
只需将以下内容添加到 ansible.cfg:
interpreter_python = /usr/bin/python