webhook-callback-poc/webhook_test_1.yml
2023-06-23 12:24:30 -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 : "5S2OtSb9KXWDyV8xYl4_Rvucz2KZHyFDRkFbRzLj78yP"
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."