diff --git a/roles/trigger-readthedocs/tasks/main.yaml b/roles/trigger-readthedocs/tasks/main.yaml index f166da7dc..9a720832b 100644 --- a/roles/trigger-readthedocs/tasks/main.yaml +++ b/roles/trigger-readthedocs/tasks/main.yaml @@ -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