Files
ansible-tasks/playbooks/pis-setup.yml
Ozzy 84ab4bb1a5
Some checks failed
ansible-lint / ansible-lint (push) Failing after 2s
Add pi setup
2024-09-13 11:41:03 +01:00

34 lines
886 B
YAML

- hosts: pis
become: yes
tasks:
- name: Update APT Cache
apt:
update_cache: yes
- name: Install python3 + pip3
apt:
pkg: ["python3", "python3-pip"]
- name: Install Uptime Kuma module
pip:
name: uptime-kuma-api
- name: Uptime Kuma login
lucasheld.uptime_kuma.login:
api_url: http://uptime.terra.lan
api_username: ozzy
api_password: 2UxVqjDDDQj23DQ
register: result
- name: Extract Uptime Kuma token
set_fact:
uptime_token: "{{ result.token }}"
- name: Create uptime monitor
lucasheld.uptime_kuma.monitor:
api_url: http://uptime.terra.lan
api_token: "{{ uptime_token }}"
hostname: "{{ inventory_hostname }}"
name: "{{ inventory_hostname_short }}"
type: ping
maxretries: 5
notification_names: ["Gotify"]