How do I get logs/details of ansible-playbook module executions?

后端 未结 6 1942
攒了一身酷
攒了一身酷 2020-12-22 18:45

Say I execute the following.

$ cat test.sh
#!/bin/bash
echo Hello World
exit 0

$ cat Hello.yml
---

- hosts: MyTestHost
  tasks:
  - name: Hello yourself
           


        
6条回答
  •  星月不相逢
    2020-12-22 19:07

    There is also other way to generate log file.

    Before running ansible-playbook run the following commands to enable logging:

    • Specify the location for the log file.

      export ANSIBLE_LOG_PATH=~/ansible.log

    • Enable Debug

      export ANSIBLE_DEBUG=True

    • To check that generated log file.

      less $ANSIBLE_LOG_PATH

提交回复
热议问题