Closed JG127 closed 3 years ago
Nobody have had this issue ?
I have the exact same problem. To bypass it, I tried to call the JSON api of Zabbix directly, like so
r = requests.post(
f'{host}/api_jsonrpc.php',
json={
"jsonrpc": "2.0",
"method": "configuration.import",
"auth": token,
"id": 1,
"params": {
"format": "xml",
"source": content,
"rules": {
"groups": {
"createMissing": True,
},
"templates": {
"createMissing": True,
"updateExisting": True,
},
"templateLinkage": {
"createMissing": True,
},
},
},
},
)
So it's working however if I start to add some rules like triggers, alerts, ect.... I cannot import my templates at all
Zabbix 5.2 has received and undocumented change (not in Zabbix 5.2 API changes) to rules. Rule templateScreens
was renamed to templateDashboards
. Fix for this issue was presented in #262 and works when running latest version of this collection from the source.
However, it was not yet released to galaxy.ansible.com and latest 1.1.0 is considered affected by this "change". We will prepare 1.2.0 release of this collection soon so it should work with next ansible release.
I was now also able to reproduce load order of collections. Ansible 2.9 seems to be ignoring collections/ansible_collections/
directory placed to the project root. More info in https://github.com/ansible-collections/community.zabbix/issues/286#issuecomment-751219128
@JG127 with 1.2.0 out, are you still seeing this problem?
this issue is dormant and we are not experiencing the reported problems with Zabbix server 5.2 (Zabbix server 5.4 is a different story and has its own issues opened in this repo), thus I am closing this.
Please feel free to reopen if you are still experiencing the problems with 5.2
SUMMARY
Can not import a template with the zabbix_template module.
ISSUE TYPE
COMPONENT NAME
zabbix_template module
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT / Zabbix Version
Linux amd64 / Mint 20 Zabbix 5.2.2 from https://github.com/zabbix/zabbix-docker docker compose file docker-compose_v3_alpine_pgsql_latest.yaml Docker CE 19.03.14, build 5eb3275d40 docker-compose version 1.24.1, build 4667896b Python library zabbix-api 0.5.4
STEPS TO REPRODUCE
The command: ansible-playbook -vvv template.yml
The playbook:
The template json in /tmp/template.json:
EXPECTED RESULTS
This should have succeeded.
ACTUAL RESULTS
When running the playbook the error message as shown below. I'm getting this very same message for anything I'm trying to do with templates.