Skip to content

Instantly share code, notes, and snippets.

@toast38coza
Created June 24, 2015 07:48
Show Gist options
  • Save toast38coza/6a5e4a452106426ac20e to your computer and use it in GitHub Desktop.
Save toast38coza/6a5e4a452106426ac20e to your computer and use it in GitHub Desktop.
Creating github service webhooks with Ansible uri_module
{
"name": "jenkins",
"active": true,
"events": [
"push"
],
"config": {
"jenkins_hook_url": "http://ci.jenkins-ci.org/github-webhook/"
}
}
- name: Jenkins webhook
uri:
url: https://api.github.com/repos/{{github_repo}}/hooks
method: POST
user: ...
password: ...
body: "{{ lookup('file','files/github/jenkins-webhook.json') }}"
force_basic_auth: yes
status_code: 200,201
body_format: json
tags:
- jenkins
- webhooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment