Closed apiening closed 2 years ago
it seems schema.sql path was changed in 5.2 from /usr/share/doc/zabbix-proxy-mysql to /usr/share/doc/zabbix-sql-scripts/mysql
but actual code is judging "grater than 5.4" or not. I think this is mistake, its have to be ↓
diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml
index e84b8aa..447b6dd 100644
--- a/roles/zabbix_proxy/tasks/Debian.yml
+++ b/roles/zabbix_proxy/tasks/Debian.yml
@@ -20,23 +20,23 @@
- init
- config
-- name: "Debian | Set some facts for Zabbix >= 3.0 && < 5.4"
+- name: "Debian | Set some facts for Zabbix >= 3.0 && < 5.2"
set_fact:
apache_log: apache2
datafiles_path: /usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}
when:
- zabbix_version is version('3.0', '>=')
- - zabbix_version is version('5.4', '<')
+ - zabbix_version is version('5.2', '<')
tags:
- zabbix-proxy
- init
- config
-- name: "Debian | Set some facts for Zabbix >= 5.4"
+- name: "Debian | Set some facts for Zabbix >= 5.2"
set_fact:
datafiles_path: /usr/share/doc/zabbix-sql-scripts/{{ zabbix_proxy_database_long }}
when:
- - zabbix_version is version('5.4', '>=')
+ - zabbix_version is version('5.2', '>=')
tags:
- zabbix-server
- init
Yes it seems so. Last findings perfectly correct.
Thank you very much for your investigation.
I also tried to dig a little bit into this and I found that I had the zabbix-proxy 5.4
package installed. And I think that happened because the variable zabbix_proxy_version: 5.2
was not set on my first run because of a typo in my host_vars
file.
When the playbook was applied again, the zabbix proxy installation was not downgraded to version 5.2 which is reasonable to me.
Then I removed the zabbix-proxy package from the system (it was a clean install anyway) and applied the playbook with the given variables again. This time it worked without any issues.
I'm afraid I ran into this issue just because the package was installed with a newer version.
One idea regarding this is to get the version of the installed zabbix-proxy package as a fact and use this to build the SQL path instead of depending on the variable.
Then I removed the zabbix-proxy package from the system (it was a clean install anyway) and applied the playbook with the given variables again. This time it worked without any issues.
it was good!
it seems schema.sql path was changed in 5.2 from /usr/share/doc/zabbix-proxy-mysql to /usr/share/doc/zabbix-sql-scripts/mysql
Sorry, this is a misunderstanding.
Closes this issue as this was not related to the code.
SUMMARY
The task [community.zabbix.zabbix_proxy : Get the file for schema.sql] fails on Ubuntu 20.04 LTS. The schema could not be selected from
/usr/share/doc/zabbix-proxy-mysql
because it is at another location. From what I see in the task, it should be sufficient to set the variabledatafiles_path
to/usr/share/doc/zabbix-sql-scripts/mysql
.ISSUE TYPE
COMPONENT NAME
community.zabbix.zabbix_proxy : Get the file for schema.sql
ANSIBLE VERSION
OS / ENVIRONMENT / Zabbix Version
zabbix_proxy_version: 5.2 zabbix_proxy_database: mysql zabbix_proxy_database_long: mysql
STEPS TO REPRODUCE
Apply the role to a Ubuntu 20.04 LTS system with the vars given in the section above.
Example playbook:
EXPECTED RESULTS
SQL schema from
/usr/share/doc/zabbix-sql-scripts/mysql
should be selected and loaded into the DB.ACTUAL RESULTS