saltstack-formulas / zabbix-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
50 stars 121 forks source link

zabbix_db using localhost #89

Closed paulrolandw closed 6 years ago

paulrolandw commented 6 years ago

Hi, having a bit of an issue here.

Apparently in mysql/conf.sls there is this: {% set settings = salt['pillar.get']('zabbix-mysql', {}) -%} Where dbhost etc is being configured.

I do have the pillar for zabbix.sls:

zabbix-mysql: dbhost: 192.168.1.99 dbname: zabbix dbuser: zabbix dbpass: sum_pass

Then the state file:

linux1:

However for some reasons this gets ignored, and fails with this:


      ID: zabbix_db
Function: mysql_database.present
    Name: zabbix
  Result: False
 Comment: MySQL Error 2003: Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)
 Started: 11:31:10.170065
Duration: 7.631 ms
 Changes:

      ID: zabbix_db
Function: mysql_user.present
    Name: zabbix
  Result: False
 Comment: MySQL Error 2003: Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)
 Started: 11:31:10.180416
Duration: 1.189 ms
 Changes:

      ID: zabbix_db
Function: mysql_grants.present
  Result: False
 Comment: One or more requisite failed: zabbix.mysql.conf.zabbix_db
 Changes:
hatifnatt commented 6 years ago

Can you please provide output of salt 'yourhost' state.show_sls zabbix.mysql.conf,zabbix.mysql.conf --out=yaml. Also salt 'youhost' pillar.get zabbix-mysql --out=yaml will be useful too. Don't forget to clean sensitive data.

Actually if you want to connect to another host with running MySQL server you need to provide dbroot_user dbroot_pass, otherwise it will always connect to localhost.

paulrolandw commented 6 years ago

Hello I am closing this ticket simply due lack of time and I will not be updating/creating schema at the moment. dbroot user pass and host were defined.