fix ansible-lint errors

This commit is contained in:
Sergey Malyuk
2025-12-17 17:47:17 +03:00
parent 8d365a82df
commit 987ba2279d
8 changed files with 45 additions and 44 deletions

View File

@@ -1,33 +1,33 @@
---
- name: "Wait for uptime-kuma to start"
ansible.builtin.wait_for:
port: "{{ kuma_port }}"
port: "{{ uptime_kuma_port }}"
timeout: 30
- name: "Set up uptime-kuma credentials"
lucasheld.uptime_kuma.setup:
api_url: http://127.0.0.1:{{ kuma_port }}
api_url: http://127.0.0.1:{{ uptime_kuma_port }}
api_username: "{{ kuma_api_username }}"
api_password: "{{ kuma_api_password }}"
- name: "Login with credentials once and register the result"
register: result
register: uptime_kuma_result
lucasheld.uptime_kuma.login:
api_url: http://127.0.0.1:{{ kuma_port }}
api_url: http://127.0.0.1:{{ uptime_kuma_port }}
api_username: "{{ kuma_api_username }}"
api_password: "{{ kuma_api_password }}"
- name: "Extract the token from the result and set it as fact"
ansible.builtin.set_fact:
kuma_api_token: "{{ result.token }}"
uptime_kuma_api_token: "{{ uptime_kuma_result.token }}"
- name: "Configure Telegram notification method"
when:
- kuma_tg_bot_token is defined
- kuma_tg_chat_id is defined
lucasheld.uptime_kuma.notification:
api_url: http://127.0.0.1:{{ kuma_port }}
api_token: "{{ kuma_api_token }}"
api_url: http://127.0.0.1:{{ uptime_kuma_port }}
api_token: "{{ uptime_kuma_api_token }}"
type: telegram
name: "{{ kuma_tg_notif_name | default('Telegram alerts') }}"
isDefault: "{{ kuma_tg_notif_is_default | default(true) }}"
@@ -40,16 +40,16 @@
when: kuma_monitor_groups is defined
loop: "{{ kuma_monitor_groups }}"
lucasheld.uptime_kuma.monitor:
api_url: http://127.0.0.1:{{ kuma_port }}
api_token: "{{ kuma_api_token }}"
api_url: http://127.0.0.1:{{ uptime_kuma_port }}
api_token: "{{ uptime_kuma_api_token }}"
type: "group"
name: "{{ item }}"
- name: "Create monitors"
loop: "{{ kuma_monitors }}"
lucasheld.uptime_kuma.monitor:
api_url: http://127.0.0.1:{{ kuma_port }}
api_token: "{{ kuma_api_token }}"
api_url: http://127.0.0.1:{{ uptime_kuma_port }}
api_token: "{{ uptime_kuma_api_token }}"
type: "{{ item.type }}"
name: "{{ item.name }}"
upsideDown: "{{ item.upside_down | default(false) }}"
@@ -59,7 +59,7 @@
interval: "{{ item.interval | default(60) }}"
description: "{{ item.description | default(omit) }}"
parent_name: "{{ item.parent_name | default(omit) }}"
notification_names: "{{ item.notification_names | default(kuma_default_notification_names) }}"
notification_names: "{{ item.notification_names | default(uptime_kuma_default_notification_names) }}"
state: "{{ kuma_tg_notif_state | default('present') }}"
ignoreTls: "{{ item.ignore_tls | default(false) }}"
jsonPath: "{{ item.query | default(omit) }}"

View File

@@ -1,7 +1,7 @@
---
- name: "Ensure project directory exists"
ansible.builtin.file:
path: "{{ kuma_project_dir }}"
path: "{{ uptime_kuma_project_dir }}"
state: directory
owner: root
group: root
@@ -10,7 +10,7 @@
- name: "Push the Compose file"
ansible.builtin.template:
src: "docker-compose.yml.j2"
dest: "{{ kuma_project_dir }}/docker-compose.yml"
dest: "{{ uptime_kuma_project_dir }}/docker-compose.yml"
owner: root
group: root
mode: "0660"
@@ -18,10 +18,10 @@
- name: "Deploy uptime-kuma via Docker Compose"
community.docker.docker_compose_v2:
state: present
project_src: "{{ kuma_project_dir }}"
project_src: "{{ uptime_kuma_project_dir }}"
- name: "Install Python dependencies"
ansible.builtin.pip:
name: "uptime-kuma-api"
version: "{{ kuma_api_version }}"
version: "{{ uptime_kuma_api_version }}"
break_system_packages: true