From ac38e37eae9f1c113b524ad14152615a937433d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Tue, 21 Feb 2023 14:54:29 +0100 Subject: [PATCH] ntfy_client: Switch to access token authentication --- roles/ntfy_client/tasks/main.yml | 2 +- roles/ntfy_client/templates/curl-ntfy.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ntfy_client/tasks/main.yml b/roles/ntfy_client/tasks/main.yml index d092fc2..749d919 100644 --- a/roles/ntfy_client/tasks/main.yml +++ b/roles/ntfy_client/tasks/main.yml @@ -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: diff --git a/roles/ntfy_client/templates/curl-ntfy.j2 b/roles/ntfy_client/templates/curl-ntfy.j2 index dec9295..8bba13f 100644 --- a/roles/ntfy_client/templates/curl-ntfy.j2 +++ b/roles/ntfy_client/templates/curl-ntfy.j2 @@ -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 -- 2.44.0