How to debug Ansible issues?

后端 未结 7 1934
滥情空心
滥情空心 2020-12-08 04:26

Sometimes, ansible doesn\'t do what you want. And increasing verbosity doesn\'t help. For example, I\'m now trying to start coturn server, which co

7条回答
  •  半阙折子戏
    2020-12-08 05:11

    1st approach: Debugging Ansible module via q module and print the debug logs via the q module as q('Debug statement'). Please check q module page to check where in tmp directory the logs would get generated in the majority of the case either it'll be generated either at: $TMPDIR\q or \tmp\q, so one can do tail -f $TMPDIR\q to check the logs generated once the Ansible module play runs (ref: q module).

    2nd Approach: If the play is running on localhost one can use pdb module to debug the play following respective doc: https://docs.ansible.com/ansible/latest/dev_guide/debugging.html

    3rd Approach: Using Ansible debug module to print the play result and debug the module(ref: Debug module).

提交回复
热议问题