~xenrox/ansible

ac38e37eae9f1c113b524ad14152615a937433d0 — Thorben Günther 1 year, 2 months ago e7b1b04
ntfy_client: Switch to access token authentication
2 files changed, 2 insertions(+), 2 deletions(-)

M roles/ntfy_client/tasks/main.yml
M roles/ntfy_client/templates/curl-ntfy.j2
M roles/ntfy_client/tasks/main.yml => roles/ntfy_client/tasks/main.yml +1 -1
@@ 1,7 1,7 @@
---
- name: Get secrets
  ansible.builtin.set_fact:
    infrastructure_password: "{{ lookup('community.hashi_vault.hashi_vault', 'ansible/data/ntfy:infrastructure_password') }}"
    access_token: "{{ lookup('community.hashi_vault.hashi_vault', 'ansible/data/ntfy:access-token') }}"

- name: Install curl wrapper
  ansible.builtin.template:

M roles/ntfy_client/templates/curl-ntfy.j2 => roles/ntfy_client/templates/curl-ntfy.j2 +1 -1
@@ 2,4 2,4 @@

PRIORITY=${3:-3}

curl -X POST -u infrastructure:{{ infrastructure_password }} -H "X-Title: $1" -H "X-Priority: $PRIORITY" -d "$2" https://ntfy.xenrox.net/infrastructure
curl -X POST -H "Authorization: Bearer {{ access_token }}" -H "X-Title: $1" -H "X-Priority: $PRIORITY" -d "$2" https://ntfy.xenrox.net/infrastructure