ansible-zabbix-server icon indicating copy to clipboard operation
ansible-zabbix-server copied to clipboard

move db creation file to delegated_dbhost

Open oskapt opened this issue 6 years ago • 4 comments

Description of PR

This change will retrieve the file used to initialize the database and then copy it to the delegated_dbhost before loading it. it intentionally does not remove the file afterward, in case something goes wrong and the file needs to be re-imported. it also only executes for the series of conditions around zabbix >=3.0 and was only tested on Ubuntu.

Type of change

Bugfix Pull Request

Fixes an issue

it fixes #96.

oskapt avatar Jul 22 '18 14:07 oskapt

Hi @oskapt

The CI test failed with error:

    TASK [ansible-zabbix-server : MySQL | Create database and import file >= 3.0] ***
    skipping: [zabbix-server-pgsql-centos]
    skipping: [zabbix-server-pgsql-debian]
    skipping: [zabbix-server-pgsql-ubuntu]
    fatal: [zabbix-server-mysql-centos -> zabbix-server-mysql-centos]: FAILED! => {"changed": false, "failed": true, "msg": "target /var/tmp/zabbix-server-mysql-centos//usr/share/doc/zabbix-server-mysql-3.4.11/create.sql.gz does not exist on the host"}
    fatal: [zabbix-server-mysql-debian -> zabbix-server-mysql-debian]: FAILED! => {"changed": false, "failed": true, "msg": "target /var/tmp/zabbix-server-mysql-debian//usr/share/doc/zabbix-server-mysql/create.sql.gz does not exist on the host"}
    fatal: [zabbix-server-mysql-ubuntu -> zabbix-server-mysql-ubuntu]: FAILED! => {"changed": false, "failed": true, "msg": "target /var/tmp/zabbix-server-mysql-ubuntu//usr/share/doc/zabbix-server-mysql/create.sql.gz does not exist on the host"}
    
    TASK [ansible-zabbix-server : Check if we have sql_done files >= 3.0] **********
    skipping: [zabbix-server-pgsql-centos]
    skipping: [zabbix-server-pgsql-debian]
    skipping: [zabbix-server-pgsql-ubuntu]

Could you please take a look at it? Thanks!

dj-wasabi avatar Jul 23 '18 08:07 dj-wasabi

i have a local change that should fix this, but i'm unable to test it without building a new zabbix system for testing. how can i replicate your CI environment? i'd like to know that everything works before updating the PR.

oskapt avatar Jul 30 '18 19:07 oskapt

Install Molecule and do a molecule test. If this exit with a status code of 0 than all is fine. See: https://molecule.readthedocs.io/en/latest/

dj-wasabi avatar Jul 31 '18 05:07 dj-wasabi

@oskapt

How is it going? Do you need some help? Should I take a look at how to implement this and maybe add it to the molecule tests?

dj-wasabi avatar Aug 18 '18 09:08 dj-wasabi