我需要每个主机(服务器)的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)