Jordan,

Have you looked at the slack callback plugin that is already bundled with
ansible?

In your ansible.cfg you would need to have something like:

[defaults]
callback_whitelist = slack

The docstring for the callback has information about what environment
variables need to be set up for it to work:

https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/callback/slack.py#L43-L56

To get it to display things like tags, skip tags, limit, etc...you will
need to set SLACK_INVOCATION=True

On Thu, Sep 1, 2016 at 10:40 AM, Jordan Cohen <[email protected]> wrote:

> I am integrating some automated slack messaging in ansible to inform on
> ansible runs and it would be useful to display information such as:
>
> Current tags in push
> Current skip-tags in push
> Current limit (though I know i can use play_hosts for listing the servers)
>
> To be honest, the whole ansible command would be helpful.  I am doing this
> with a local action shell now:
>
> shell ps aux | grep 'ansible-playbook' | grep -v grep
>
> ...but besides it being very janky, this is unpredictable if there are
> multiple ansible-playbooks running on one host, like in my jenkins server.
>
> I scanned all the built in vars that I know of for some of this
> information but no luck.
>
> Thanks!
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/97c23341-c49a-447c-beea-a9592c8a1959%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/97c23341-c49a-447c-beea-a9592c8a1959%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v8svdDpG0v_H_BOnpV5bqn4Uq9hCqwziX_huEMMU0h4hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to