# Ansible command line

**URL:** <https://forum.ansible.com/t/ansible-command-line/17797>\
**Category:** Ansible Project\
**Created:** [March 19, 2015, 9:22pm UTC](https://forum.ansible.com/t/ansible-command-line/17797 "2015-03-19T21:22:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nebular.wolf](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@nebular.wolf](https://forum.ansible.com/u/nebular.wolf)\
**Post date:** [March 19, 2015, 9:22pm UTC](https://forum.ansible.com/t/ansible-command-line/17797/1 "2015-03-19T21:22:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 19, 2015, 9:33pm UTC](https://forum.ansible.com/t/ansible-command-line/17797/2 "2015-03-19T21:33:25Z")

</div>

no, nothing currently exposes this information.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 20, 2015, 12:10am UTC](https://forum.ansible.com/t/ansible-command-line/17797/3 "2015-03-20T00:10:50Z")

</div>

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](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:

[https://github.com/sivel/ansible/blob/slack-callback/plugins/callbacks/slack.py#L142-L147](https://github.com/sivel/ansible/blob/slack-callback/plugins/callbacks/slack.py#L142-L147)

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

---

<div class="post-metadata">

**Author:** ![nebular.wolf](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@nebular.wolf](https://forum.ansible.com/u/nebular.wolf)\
**Post date:** [March 20, 2015, 7:51pm UTC](https://forum.ansible.com/t/ansible-command-line/17797/4 "2015-03-20T19:51:14Z")

</div>

That was exactly what I was looking for.

Thanks!
