小编Pra*_*h S的帖子

如何以人类可读的方式格式化 ansible 日志

我需要每个主机(服务器)的ansible日志,所以我在ansible.cfg中使用logs_play模块。

callback_whitelist = log_plays
Run Code Online (Sandbox Code Playgroud)

但输出结果对人类并不友好。请参阅下面的示例日志:

Apr 10 2020 12:23:35 - OK - omitted

Apr 10 2020 12:23:46 - OK - {"results": [{"msg": "", "invocation": {"module_args": {"lock_timeout": 30, "update_cache": false, "disable_excludes": null, "exclude": [], "allow_downgrade": false, "disable_gpg_check": false, "conf_file": null, "use_backend": "auto", "state": "installed", "disablerepo": [], "releasever": null, "skip_broken": false, "autoremove": false, "download_dir": null, "enable_plugin": [], "installroot": "/", "install_weak_deps": true, "name": ["vim", "git"], "download_only": false, "bugfix": false, "list": null, "install_repoquery": true, "update_only": false, "disable_plugin": [], "enablerepo": [], "security": false, "validate_certs": true}}, …
Run Code Online (Sandbox Code Playgroud)

logging ansible

3
推荐指数
1
解决办法
5051
查看次数

标签 统计

ansible ×1

logging ×1