Ansible command line

86 views
Skip to first unread message

nebula...@gmail.com

unread,
Mar 19, 2015, 5:22:27 PM3/19/15
to ansible...@googlegroups.com
Is there a way to get the command line used to invoke ansible from a playbook/role.

After the playbook is completed I'd like to send a notification (Email, Hipchat, etc) to a group with the details of what was run and how it went.

Brian Coca

unread,
Mar 19, 2015, 5:33:30 PM3/19/15
to ansible...@googlegroups.com
no, nothing currently exposes this information.

--
Brian Coca

Matt Martz

unread,
Mar 19, 2015, 8:11:40 PM3/19/15
to ansible...@googlegroups.com
You can achieve this with a callback plugin.

You have a few options, you can get the actual command via some callback that looks like:  https://gist.github.com/sivel/105347f6df18691446b0

Otherwise, you can infer provided command line options by using something like what I have done in a slack callback plugin that we use:



That slack callback is in a PR available at: https://github.com/ansible/ansible/pull/8955

On Thu, Mar 19, 2015 at 4:22 PM, <nebula...@gmail.com> wrote:
Is there a way to get the command line used to invoke ansible from a playbook/role.

After the playbook is completed I'd like to send a notification (Email, Hipchat, etc) to a group with the details of what was run and how it went.

--
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/5fad795f-5ad6-4e68-9e94-f7891fa35c01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

nebula...@gmail.com

unread,
Mar 20, 2015, 3:51:14 PM3/20/15
to ansible...@googlegroups.com
That was exactly what I was looking for.

Thanks!
Reply all
Reply to author
Forward
0 new messages