Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

task "Ensure proxy definition is up-to-date (added/updated/removed)" in "zabbix_proxy" role seems to be not compatible with zabbix 7 #1418

Open
dshuffin opened this issue Nov 7, 2024 · 0 comments

Comments

@dshuffin
Copy link

dshuffin commented Nov 7, 2024

SUMMARY

When I try to register a passive proxy with zabbix_proxy role the play fails at "Ensure proxy definition is up-to-date (added/updated/removed)" task.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

"Ensure proxy definition is up-to-date (added/updated/removed)" in zabbix_proxy role

ANSIBLE VERSION
ansible [core 2.17.5]
  config file = /home/<>/infrastructure/ansible.cfg
  configured module search path = ['/home/<>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/<>/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

CONFIGURATION
CONFIG_FILE() = /home/<>/infrastructure/ansible.cfg
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/<>/infrastructure/ansible.cfg) = True
DEFAULT_MANAGED_STR(/home/<>/infrastructure/ansible.cfg) = $Managed with Ansible$
DEFAULT_ROLES_PATH(/home/<>/infrastructure/ansible.cfg) = ['/home/<>/infrastructure/galaxy_roles', '/home/<>/infrastructure/roles']
DEFAULT_STDOUT_CALLBACK(/home/<>/infrastructure/ansible.cfg) = yaml
DEFAULT_TIMEOUT(/home/<>/infrastructure/ansible.cfg) = 60

OS / ENVIRONMENT / Zabbix Version

zabbix 7 on ubuntu 24.04

STEPS TO REPRODUCE

try to register zabbix 7 proxy to zabbix 7 host with zabbix_proxy role using 3.1.2 version of collection

in proxy inventory:

zabbix_api_create_proxy: true
zabbix_proxy_status: passive
zabbix_proxy_name: "{{ inventory_hostname }}"
zabbix_proxy_interface:
  useip: 0
  dns: "{{ inventory_hostname }}"
  port: 10051
zabbix_api_server_host: zabbix.webserver.hostname
zabbix_api_server_port: 443
zabbix_api_login_user: Admin
zabbix_api_login_pass: zabbix
zabbix_api_use_ssl: true
zabbix_proxy_tlspskfile: /home/zabbix/zabbix_proxy.psk
zabbix_proxy_tlspskidentity: "PSK {{ inventory_hostname }}"
zabbix_proxy_tlsaccept: psk # required for psk to work
EXPECTED RESULTS

Task succeeds and registers proxy

ACTUAL RESULTS

Task fails. Even though zabbix_proxy_status set to passive from output below it's clear that task sets operating_mode to active. This causes other parameters incompatibility which causes task to fail


TASK [community.zabbix.zabbix_proxy : Ensure proxy definition is up-to-date (added/updated/removed)] **************************************************************************************************************************************
task path: /home/<>/.ansible/collections/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/main.yml:128
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /usr/lib/python3/dist-packages/ansible_collections/ansible/netcommon
Loading collection ansible.utils from /usr/lib/python3/dist-packages/ansible_collections/ansible/utils
<zabbix.webserver.hostname> attempting to start connection
<zabbix.webserver.hostname> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /usr/bin/ansible-connection
<zabbix.webserver.hostname> local domain socket does not exist, starting it
<zabbix.webserver.hostname> control socket path is /home/<>/.ansible/pc/58b18c7e2e
<zabbix.webserver.hostname> Loading collection ansible.builtin from
<zabbix.webserver.hostname> redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
<zabbix.webserver.hostname> Loading collection ansible.netcommon from /usr/lib/python3/dist-packages/ansible_collections/ansible/netcommon
<zabbix.webserver.hostname> Loading collection ansible.utils from /usr/lib/python3/dist-packages/ansible_collections/ansible/utils
<zabbix.webserver.hostname> Loading collection community.zabbix from /home/<>/.ansible/collections/ansible_collections/community/zabbix
<zabbix.webserver.hostname> local domain socket listeners started successfully
<zabbix.webserver.hostname> loaded API plugin ansible_collections.community.zabbix.plugins.httpapi.zabbix from path /home/<>/.ansible/collections/ansible_collections/community/zabbix/plugins/httpapi/zabbix.py for platform type community.zabbix.zabbix
<zabbix.webserver.hostname> Loading collection ansible.builtin from
<zabbix.webserver.hostname> local domain socket path is /home/<>/.ansible/pc/58b18c7e2e
<zabbix.webserver.hostname> ESTABLISH LOCAL CONNECTION FOR USER: <>
<zabbix.webserver.hostname> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk `"&& mkdir "` echo /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/ansible-tmp-1730988480.1149783-75066-203804066132421 `" && echo ansible-tmp-1730988480.1149783-75066-203804066132421="` echo /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/ansible-tmp-1730988480.1149783-75066-203804066132421 `" ) && sleep 0'
Using module file /home/<>/.ansible/collections/ansible_collections/community/zabbix/plugins/modules/zabbix_proxy.py
<zabbix.webserver.hostname> PUT /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/tmpmc7efzyi TO /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/ansible-tmp-1730988480.1149783-75066-203804066132421/AnsiballZ_zabbix_proxy.py
<zabbix.webserver.hostname> EXEC /bin/sh -c 'chmod u+x /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/ansible-tmp-1730988480.1149783-75066-203804066132421/ /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/ansible-tmp-1730988480.1149783-75066-203804066132421/AnsiballZ_zabbix_proxy.py && sleep 0'
<zabbix.webserver.hostname> EXEC /bin/sh -c '/usr/bin/python3 /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/ansible-tmp-1730988480.1149783-75066-203804066132421/AnsiballZ_zabbix_proxy.py && sleep 0'
<zabbix.webserver.hostname> EXEC /bin/sh -c 'rm -f -r /home/<>/.ansible/tmp/ansible-local-74710jf6o48dk/ansible-tmp-1730988480.1149783-75066-203804066132421/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
  File "/tmp/ansible_community.zabbix.zabbix_proxy_payload_95makeya/ansible_community.zabbix.zabbix_proxy_payload.zip/ansible_collections/community/zabbix/plugins/module_utils/api_request.py", line 29, in _httpapi_error_handle
    code, response = self.connection.send_request(data=payload)
  File "/tmp/ansible_community.zabbix.zabbix_proxy_payload_95makeya/ansible_community.zabbix.zabbix_proxy_payload.zip/ansible/module_utils/connection.py", line 199, in __rpc__
    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [zabbix.proxy.hostname -> zabbix.webserver.hostname]: FAILED! => changed=false
  invocation:
    module_args:
      address: null
      allowed_addresses: null
      ca_cert: null
      custom_timeouts: 0
      description: null
      http_login_password: null
      http_login_user: null
      interface:
        dns: zabbix.proxy.hostname
        ip: ''
        port: '10051'
        useip: 0
      local_address: null
      local_port: '10051'
      operating_mode: active
      port: '10051'
      proxy_address: null
      proxy_group: null
      proxy_name: zabbix.proxy.hostname
      state: present
      status: passive
      timeout_browser: null
      timeout_db_monitor: null
      timeout_external_check: null
      timeout_http_agent: null
      timeout_script: null
      timeout_simple_check: null
      timeout_snmp_agent: null
      timeout_ssh_agent: null
      timeout_telnet_agent: null
      timeout_zabbix_agent: null
      tls_accept: no_encryption
      tls_connect: PSK
      tls_psk: null
      tls_psk_identity: PSK zabbix.proxy.hostname
      tls_subject: null
  msg: 'connection error occurred: REST API returned {''code'': -32602, ''message'': ''Invalid params.'', ''data'': ''Invalid parameter "/1/tls_connect": value must be 1.''} when sending {"jsonrpc": "2.0", "method": "proxy.create", "id": "bf79f396-f690-4f0d-91a8-1285ff85604d", "params": {"name": "zabbix.proxy.hostname", "operating_mode": "0", "tls_connect": "2", "tls_accept": "1", "tls_psk_identity": "PSK zabbix.proxy.hostname", "port": "10051", "local_port": "10051"}, "auth": "994610155a61a4726ee770cc3345f200"}'


# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant