lucasheld / ansible-uptime-kuma

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

Creating tag fails #18

Closed Medformatik closed 1 year ago

Medformatik commented 1 year ago

I am trying to create a tag like this:

- name: Add Development tag
  lucasheld.uptime_kuma.tag:
    api_url: http://127.0.0.1:3001
    api_token: "{{ api_token }}"
    name: Development
    color: "#0000ff"
    state: present

but it fails with this error: FAILED! => {"changed": false, "msg": "Traceback (most recent call last):\n File \"/tmp/ansible_lucasheld.uptime_kuma.tag_payload_esq43o_3/ansible_lucasheld.uptime_kuma.tag_payload.zip/ansible_collections/lucasheld/uptime_kuma/plugins/modules/tag.py\", line 129, in main\n File \"/tmp/ansible_lucasheld.uptime_kuma.tag_payload_esq43o_3/ansible_lucasheld.uptime_kuma.tag_payload.zip/ansible_collections/lucasheld/uptime_kuma/plugins/modules/tag.py\", line 89, in run\nTypeError: add_tag() takes 1 positional argument but 3 were given\n"}

lucasheld commented 1 year ago

Works fine for me with the same task. Tested with:

Which versions do you use? If it is not the latest ansible-uptime-kuma and uptime-kuma-api version, update and try again.

Medformatik commented 1 year ago

I am using exactly the same versions (ansible core 2.14.3). Here you can see how I set up everything: https://pastebin.com/siSPFXrf

lucasheld commented 1 year ago

I followed your instructions exactly. It works without problems. If these steps have not been executed on a fresh system, the installation maybe broken.

Try removing the ansible collection:

rm -fr ~/.ansible/collections/ansible_collections/lucasheld/uptime_kuma

And install the collection again:

ansible-galaxy collection install git+https://github.com/lucasheld/ansible-uptime-kuma.git

Uninstall the python package:

pip uninstall -y uptime-kuma-api

And install it again:

pip install uptime-kuma-api
Medformatik commented 1 year ago

After reinstalling the collection and the python package and also setting up the server completely new, everything worked without problems. I have no idea what the issue was.