ansible-collections / community.zabbix

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

How to update the code for the latest version of the module #1055

Closed izzzhoga closed 1 year ago

izzzhoga commented 1 year ago
SUMMARY

Hello everyone I have a huge amount of code written for version 1.8.0, but I had to update the module to the latest available version. Now I get the following error:

failed: [host -> localhost] (item=org-TEST) => {"ansible_loop_var": "item", "changed": false, "item": "org-TEST", "msg": "Unsupported parameters for (community.zabbix.zabbix_group) module: login_password, login_user, server_url. Supported parameters include: state, host_groups (host_group), http_login_password, http_login_user."}
failed: [host  -> localhost] (item=!SR-W!) => {"ansible_loop_var": "item", "changed": false, "item": "!SR-W!", "msg": "Unsupported parameters for (community.zabbix.zabbix_group) module: login_password, login_user, server_url. Supported parameters include: host_groups (host_group), http_login_user, http_login_password, state."}

I assume that the variables for the module have changed, but I do not know how to adapt my code to these changes.

My code:

  - name: Create host groups
    local_action:
      module: community.zabbix.zabbix_group
      server_url: "{{ZS_URL}}"
      login_user: "{{ZS_USER}}"
      login_password: "{{ZS_PASS}}"
      state: present
      host_groups: "{{item}}"
    with_items: "{{zb_groups_list}}"
    throttle: 10
ISSUE TYPE
COMPONENT NAME

community.zabbix.zabbix_group

ANSIBLE VERSION
ansible [core 2.13.6]
  config file = /home/user/mkt/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
  jinja version = 3.1.2
  libyaml = True
CONFIGURATION
DEFAULT_FORKS(/home/user/mkt/ansible.cfg) = 50
DEFAULT_HOST_LIST(/home/user/mkt/ansible.cfg) = ['/home/user/mkt/dynamic-inventory.yml']
DEFAULT_TIMEOUT(/home/user/mkt/ansible.cfg) = 10
DEFAULT_VAULT_PASSWORD_FILE(/home/user/mkt/ansible.cfg) = /home/user/mkt/.ansible_vault_pass
DEPRECATION_WARNINGS(/home/user/mkt/ansible.cfg) = False
HOST_KEY_CHECKING(/home/user/mkt/ansible.cfg) = False
PERSISTENT_COMMAND_TIMEOUT(/home/user/mkt/ansible.cfg) = 60
PERSISTENT_CONNECT_TIMEOUT(/home/user/mkt/ansible.cfg) = 60
RETRY_FILES_ENABLED(/home/user/mkt/ansible.cfg) = True
RETRY_FILES_SAVE_PATH(/home/user/mkt/ansible.cfg) = /home/user/mkt/retry-files
OS / ENVIRONMENT / Zabbix Version

Zabbix 6.2.7

STEPS TO REPRODUCE
  - name: Create host groups
    local_action:
      module: community.zabbix.zabbix_group
      server_url: "{{ZS_URL}}"
      login_user: "{{ZS_USER}}"
      login_password: "{{ZS_PASS}}"
      state: present
      host_groups: "{{item}}"
    with_items: "{{zb_groups_list}}"
    throttle: 10
pyrodie18 commented 1 year ago

Among other things we've moved to HTTPAPI for everything. I'd encourage you to take a look at the readme for the collection as well as the module documentation to help you out.

izzzhoga commented 1 year ago

What is the latest version of the Zabbix server that works correctly with the latest version of the module?

BGmot commented 1 year ago

What is the latest version of the Zabbix server that works correctly with the latest version of the module?

6.4

izzzhoga commented 1 year ago

What is the early version of the Zabbix server than 6.4 that works correctly with the latest version of the module?

BGmot commented 1 year ago

We officially support 6.0, 6.2 and 6.4. This is what our tests are running again. If you need earlier versions then pick older version of this collection.