lucasheld / ansible-uptime-kuma

Ansible collection of modules to configure Uptime Kuma
GNU General Public License v3.0
135 stars 19 forks source link

`settings.entryPage` adds configured option but selection is missing #26

Closed maxkratz closed 11 months ago

maxkratz commented 12 months ago

Consider the following task:

- name: Configure status page as entry page
  lucasheld.uptime_kuma.settings:
    api_url: https://{{ status_url }}
    api_token: "{{ api_token }}"  
    entryPage: "1uhosting"

The entry page "1uhosting" gets configured but the selection of the radio button within the web UI is missing: Screenshot from 2023-07-08 17-38-12

Is there another setting available to configure this selection or is this behavior a bug?

lucasheld commented 12 months ago

I have added a status page with the slug 1uhosting and then checked the HTML input field of the Uptime Kuma settings. It looks like Uptime Kuma requires the prefix statusPage- in the entryPage value to display it correctly.

- name: Add status page
  lucasheld.uptime_kuma.status_page:
    api_url: https://{{ status_url }}
    api_token: "{{ api_token }}"
    slug: 1uhosting
    title: 1uhosting
    state: present

image

So you have to replace

- name: Configure status page as entry page
  lucasheld.uptime_kuma.settings:
    api_url: https://{{ status_url }}
    api_token: "{{ api_token }}"
    entryPage: "1uhosting"

with

- name: Configure status page as entry page
  lucasheld.uptime_kuma.settings:
    api_url: https://{{ status_url }}
    api_token: "{{ api_token }}"
    entryPage: "statusPage-1uhosting"
maxkratz commented 12 months ago

@lucasheld Thank you, your proposed change fixed my Ansible role/task. May I suggest to add this information to the respective documentation?

lucasheld commented 11 months ago

Done :)