# inbound webhook support

**URL:** <https://forum.ansible.com/t/inbound-webhook-support/25755>\
**Category:** Ansible Project\
**Created:** [October 16, 2017, 10:44am UTC](https://forum.ansible.com/t/inbound-webhook-support/25755 "2017-10-16T10:44:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dch](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dch/32/7132_2.png) [@dch](https://forum.ansible.com/u/dch)\
**Post date:** [October 16, 2017, 10:44am UTC](https://forum.ansible.com/t/inbound-webhook-support/25755/1 "2017-10-16T10:44:16Z")

</div>

hi folks

I'd like to trigger ansible from a webhook - a github commit in this  
case. How have other people done this?

A+  
Dave

---

<div class="post-metadata">

**Author:** ![dch](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dch/32/7132_2.png) [@dch](https://forum.ansible.com/u/dch)\
**Post date:** [October 16, 2017, 4:31pm UTC](https://forum.ansible.com/t/inbound-webhook-support/25755/2 "2017-10-16T16:31:54Z")

</div>

I'm still interested to hear what others do, but here's a working  
solution from today's hacking using haproxy (for TLS termination and  
some access control restrictions) and exposing  
[https://github.com/adnanh/webhook](https://github.com/adnanh/webhook) and the following webhook.json file:

```json
[
    {
        "id": "ansible",
        "execute-command": "make daemons",
        "command-working-directory": "/home/deploy/src/ansible",
        "pass-arguments-to-command":
        [
            {
                "source": "payload",
                "name": "head_commit.id"
            },
            {
                "source": "payload",
                "name": "pusher.name"
            },
            {
                "source": "payload",
                "name": "pusher.email"
            }
        ],
        "trigger-rule":
        {
            "and":
            [
                {
                    "match":
                    {
                        "type": "payload-hash-sha1",
                        "secret": "{{ config.webhook.secret }}",
                        "parameter":
                        {
                            "source": "header",
                            "name": "X-Hub-Signature"
                        }
                    }
                }
            ]
        }
    }
]

```

In my case, the "entry point" for all ansible playbooks is handled in a  
Makefile. webhook provides either command-line parameter passing, or  
environment variables.

A+  
Dave
