Skip to content

AutoPSK behaviour with version >4.0.0 #1654

@exu-g

Description

@exu-g
SUMMARY

Upgrading from version 3.3.0 to 4.1.1, my setup using zabbix_agent_tlspsk_auto broke
I also tested community.zabbix version 4.0.0 to confirm the behaviour changed with the major release

It looks like this is a reoccurrence of an older bug, see #1350
Setting these additional variables works. Is this intended behaviour?

zabbix_agent_tlsaccept: 'psk'
zabbix_agent_tlsconnect: 'psk'
ISSUE TYPE
  • Bug Report
COMPONENT NAME

zabbix_agent

ANSIBLE VERSION
ansible [core 2.18.3]
  config file = /home/exu/gitprojects/xpn-playbooks/ansible.cfg
  configured module search path = ['/home/exu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/exu/gitprojects/xpn-playbooks/.venv/lib/python3.13/site-packages/ansible
  ansible collection location = /home/exu/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/exu/gitprojects/xpn-playbooks/.venv/bin/ansible
  python version = 3.13.7 (main, Aug 15 2025, 12:34:02) [GCC 15.2.1 20250813] (/home/exu/gitprojects/xpn-playbooks/.venv/bin/python)
  jinja version = 3.1.6
  libyaml = True
CONFIGURATION
CONFIG_FILE() = /home/exu/gitprojects/xpn-playbooks/ansible.cfg
DEFAULT_HOST_LIST(/home/exu/gitprojects/xpn-playbooks/ansible.cfg) = ['/home/exu/gitprojects/xpn-playbooks/inventories/inventory_netbox.yml']
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/exu/gitprojects/xpn-playbooks/vault.secret
EDITOR(env: EDITOR) = /usr/bin/vim
HOST_KEY_CHECKING(/home/exu/gitprojects/xpn-playbooks/ansible.cfg) = False
INTERPRETER_PYTHON(/home/exu/gitprojects/xpn-playbooks/ansible.cfg) = auto_silent

GALAXY_SERVERS:
OS / ENVIRONMENT / Zabbix Version

Target OS:

  • Debian 12
  • OpenSuse 15.6
STEPS TO REPRODUCE
---
- name: OS Base playbook
  hosts: all
  become: true
  become_method: ansible.builtin.sudo
  vars:
    zabbix_agent2: true
    zabbix_agent_server: <redacted>
    zabbix_agent_serveractive: <redacted>
    zabbix_api_server_host: <redacted>
    zabbix_api_server_port: 443
    zabbix_api_login_user: <redacted>
    zabbix_api_login_pass: <redacted>
    ansible_zabbix_url_path: ""
    zabbix_api_create_hostgroup: true
    zabbix_api_create_hosts: true
    zabbix_api_use_ssl: true
    zabbix_agent_host_state: present
    zabbix_agent_statusport: null # unset statusport/integrated status page
    zabbix_agent_interfaces:
      - type: 1
        main: 1
        useip: 0
        ip: "{{ primary_ip6 | default(primary_ip4) }}"
        dns: "{{ ansible_facts['hostname'] }}"
        port: "10050"
    zabbix_host_groups: "{{ sites[0]['name'] }}"
    zabbix_agent_tlspsk_auto: true
  roles:
    # install zabbix agent
    - role: community.zabbix.zabbix_agent
EXPECTED RESULTS

Zabbix Agent should be registered successfully

ACTUAL RESULTS

Create/Update host task in api.yml from zabbix_agent fails

TASK [community.zabbix.zabbix_agent : API | Create a new host or update an existing host's info] ******************************************************************************
fatal: [owl01 -> mon01]: FAILED! => {"msg": "The task includes an option with an undefined variable.. 'dict object' has no attribute 'psk,unencrypted'\n\nThe error appears to be in '/home/exu/.ansible/collections/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml': line 50, 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: \"API | Create a new host or update an existing host's info\"\n  ^ here\n"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions