saltstack / saltstack/salt

[BUG] Zabbix 6.2 - host.update: Invalid parameter "/selectParentTemplates": value must be one of "extend", "count".

Open
#62,335 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Execution-Module needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Updating host assigned zabbix templates through event -> reactor -> orchestration

Setup
salt-minion 3004.1
Zabbix-Server 6.2

Steps to Reproduce the behavior
state.apply

Expected behavior
Templates empty

Versions Report

Salt Version: Salt: 3004.1

Dependency Versions:
cffi: 1.14.6
cherrypy: unknown
dateutil: 2.8.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.11.3
libgit2: 1.1.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: 2.17
pycrypto: Not Installed
pycryptodome: 3.9.8
pygit2: 1.6.1
Python: 3.7.13 (default, Mar 18 2022, 17:55:41)
python-gnupg: 0.4.4
PyYAML: 5.4.1
PyZMQ: 18.0.1
smmap: Not Installed
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.1

System Versions:
dist: alpine 3.14.4
locale: UTF-8
machine: x86_64
release: 4.19.0-20-amd64
system: Linux
version: Alpine Linux 3.14.4

zabbix_host_assign_templates:
  zabbix_host.assign_templates:
    - host: {{ pillar['id'] }}
    - templates:
      - "Zabbix agent active"

Additional context
Solution:
/usr/lib/python3/dist-packages/salt/states/zabbix_host.py
Change line 672

  •     selectParentTemplates='["templateid"]',
    

to

  •    selectParentTemplates='extend',
    

Is working again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in salt/states/zabbix_host.py around line 672, then review the zabbix_host.assign_templates state and its generated Zabbix API parameters. Run the reported state.apply scenario against Zabbix 6.2 and confirm template assignment completes without the selectParentTemplates validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.