Use "curl" to trigger rtd.org webhook with http basic auth

For some reason (unknown really for us) triggering webhook with http
basic auth using Ansible's uri module started recently failing when it
is run on some operating systems, like e.g. Ubuntu Noble.

Let's switch to use curl command directly to trigger that webhook
instead.

Change-Id: Idbf643ea27220504ac9e37eaf9f18930d2fc08ab
This commit is contained in:
Slawek Kaplonski 2024-11-06 14:39:46 +01:00 committed by Ian Wienand
parent 8deeecf821
commit f2bc6bb699
No known key found for this signature in database

View File

@ -17,14 +17,15 @@
when: rtd_credentials.password is not defined
- name: Trigger readthedocs build webhook via authentication
uri:
method: POST
url: 'https://readthedocs.org/api/v2/webhook/{{ rtd_project_name }}/{{ rtd_webhook_id }}/'
user: '{{ rtd_credentials.username }}'
password: '{{ rtd_credentials.password }}'
# NOTE(ianw): testing it seems the API doesn't respond with
# 401 so this is required
force_basic_auth: yes
# NOTE(ianw): 2024-11-08 the URI module fails here in mysterious
# -- seeminly platform dependent -- ways; see
# https://github.com/readthedocs/readthedocs.org/issues/11753
# We call curl directly to work around this
ansible.builtin.command: >-
curl
-X POST
-u {{ rtd_credentials.username }}:{{ rtd_credentials.password }}
'https://readthedocs.org/api/v2/webhook/{{ rtd_project_name }}/{{ rtd_webhook_id }}/'
# avoid logging any credentials
no_log: true