ansible-collections / community.zabbix

Zabbix Ansible modules
http://galaxy.ansible.com/community/zabbix
Other
315 stars 266 forks source link

fixes a bug when run crushes, because zabbix_repo tries register as v… #1320

Closed XaTTa6bl4 closed 5 days ago

XaTTa6bl4 commented 5 days ago

fixes a bug when run crushes, because zabbix_repo tries register as variable, but at the same time it is a role name

TASK [community.zabbix.zabbix_repo : Debian | Update apt cache if repo was added] *************************************************************************************************
fatal: [test]: FAILED! => {"msg": "The conditional check 'zabbix_repo is changed' failed. The error was: The 'changed' test expects a dictionary\n\nThe error appears to be in '~/test/ansible/collections/ansible_collections/community/zabbix/roles/zabbix_repo/tasks/Debian.yml': line 96, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Debian | Update apt cache if repo was added\"\n  ^ here\n"}
BGmot commented 5 days ago

@pyrodie18 how come we don't catch this type of errors in our tests??

BGmot commented 5 days ago

@XaTTa6bl4 please provide Ansible, this collection and Debian versions. I am really worried that we did not catch this error in tests. Also it would be nice an issue to be created for this error and this PR to reference this issue.

XaTTa6bl4 commented 5 days ago

@XaTTa6bl4 please provide Ansible, this collection and Debian versions.

Ansible installed on MacOS:

$ ansible --version
ansible [core 2.17.1]
  configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/10.1.0/libexec/lib/python3.12/site-packages/ansible
  ansible collection location = ~/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] (/opt/homebrew/Cellar/ansible/10.1.0/libexec/bin/python)
  jinja version = 3.1.4
  libyaml = True

test host with Ubuntu:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy
pyrodie18 commented 5 days ago

Um....you got me there. Taking a look at it now.

pyrodie18 commented 5 days ago

Just looked, its running find on the runners. No error.

https://github.com/ansible-collections/community.zabbix/actions/runs/9771836712/job/27043650739

  TASK [community.zabbix.zabbix_repo : Debian | Configuring the weight for APT] ***
  skipping: [zabbix-agent-ubuntu2404]

  TASK [community.zabbix.zabbix_repo : Debian | Update apt cache if repo was added] ***
  changed: [zabbix-agent-ubuntu2404]

  TASK [zabbix_agent : Install the correct repository] ***************************
  included: /home/runner/work/community.zabbix/community.zabbix/roles/zabbix_agent/tasks/Debian.yml for zabbix-agent-ubuntu2404
pyrodie18 commented 5 days ago

Would ask to add a change fragment but want to get this out ASAP. Going to pull it in right now and will add the change fragment when I release the updated version.