webhook-callback-poc/webhook_test_1.yml
Chris Hammer e726576548 1.2.1029
--------
- Added new method to call the webhook via handler
- Added inventory_hostname to webhook calls to see who is doing what
- Updated messages for better readability
- Added comment markers for clarity
2023-06-21 22:28:38 -04:00

41 lines
1004 B
YAML

- name: "Webhook Test 1: Long running job"
hosts: all
gather_facts: false
become: false
vars:
pause_time : 1
num_retries : 5
fail_count : 30
poll_interval : 10
webhook : "https://webhooks.thezengarden.net/webhook-callback-poc"
webhook_key : "fYnWhoF42NFsN2p5tiB3Wd65HgB1oc-Qo2jXS6TTmZov"
check_commands:
- uname -a
- uptime
- ping -c 1 127.0.0.1
tasks:
- name: Include long_running_tasks.yml
ansible.builtin.include_tasks: tasks/long_running_tasks.yml
handlers:
- name: Bob
ansible.builtin.uri:
url : "{{ webhook }}"
headers:
Authorization : "Token {{ webhook_key }}"
Content-type : 'application/json'
method : POST
status_code : 200
validate_certs : false
return_content : false
body_format : json
body : |
"{{ inventory_hostname }}": "We've reached equilibrium."