This commit is contained in:
Dryusdan 2023-03-10 10:46:21 +01:00
parent fe5b8902e5
commit 29449cde6a
2 changed files with 20 additions and 12 deletions

View File

@ -41,17 +41,6 @@
tags:
- vhost
- name: Login with credentials once and register the result
lucasheld.uptime_kuma.login:
api_url: "{{ kuma_url }}"
api_username: "{{ kuma_username }}"
api_password: "{{ kuma_password }}"
register: result
- name: Extract the token from the result and set it as fact
set_fact:
api_token: "{{ result.token }}"
- name: "Add Vhost"
template:
src: "vhosts/{{ item.template }}.j2"
@ -65,6 +54,21 @@
- vhost
register: vhost_changed
- name: Login with credentials once and register the result
lucasheld.uptime_kuma.login:
api_url: "{{ kuma_url }}"
api_username: "{{ kuma_username }}"
api_password: "{{ kuma_password }}"
register: result
tags:
- vhost
- name: Extract the token from the result and set it as fact
set_fact:
api_token: "{{ result.token }}"
tags:
- vhost
- name: Login by token and create a monitor
lucasheld.uptime_kuma.monitor:
api_url: https://kuma.dryusdan.net

View File

@ -36,10 +36,14 @@
api_username: "{{ kuma_username }}"
api_password: "{{ kuma_password }}"
register: result
tags:
- resign
- name: Extract the token from the result and set it as fact
set_fact:
api_token: "{{ result.token }}"
tags:
- resign
- name: Login by token and create a monitor
lucasheld.uptime_kuma.monitor:
@ -57,5 +61,5 @@
when:
- item.state == "absent"
tags:
- vhost
- resign