Collect playbook results

93 views
Skip to first unread message

Ulrich Schreiner

unread,
Aug 6, 2014, 9:56:18 AM8/6/14
to ansible...@googlegroups.com
hi,

we currently use ansible with a playbook to install software packages on many servers. the installation is a vendor specific shell-script and we need the output of this script. currently i use the "mail" action to send the output, but with many hosts in my inventory i'm sending many mails.

is there an option to execute a task (or something similar) after all hosts have their tasks done? and do i have access to their registered variables like a "task_variables" list where i can iterate over?

thanks
</usc>


Michael DeHaan

unread,
Aug 6, 2014, 10:03:23 AM8/6/14
to ansible...@googlegroups.com
Probably the best option is you could write a callback plugin that sends an email.  We actually have an example of this that would run when a playbook completes:


See the docs for info about writing callback plugins if interested, but basically you would drop this int he callback plugin path as configured in ansible.cfg.

Hope that helps!

you may wish to adapt the script to your particular needs.




--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5b174229-469d-4090-b1e7-39793ba5073e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages