How to access the playbook execution log file at run time?

12 views
Skip to first unread message

Luiz Gustavo

unread,
Jun 16, 2024, 10:57:09 AM (13 days ago) Jun 16
to ansible...@googlegroups.com
Hey guys,

How to access the playbook execution log file at run time? I would need to email it after running the playbook.

For example, a simple playbook:

---
- hosts: localhost
  tasks:
  - name: "display message"
    debug:
      msg: "Hello"

I would need to email the execution output:

PLAY [localhost] *********************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************
ok: [localhost]

TASK [display message] ***************************************************************************************************************************************
ok: [localhost] => {
    "msg": "Hello"
}

PLAY RECAP ***************************************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


PS.:
I cannot set the ANSIBLE_LOG_PATH environment variable before executing the playbook because the execution will be done through AWX and not through the command line.

Will McDonald

unread,
Jun 16, 2024, 11:21:18 AM (13 days ago) Jun 16
to ansible...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL-Q%3DKvUjWhhAE5mmhpU8r8FSS0EzkzKH-zGivBLf3%2BjZqq65Q%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages