From 41aa9c626c02222729cba4de81cb21a467891b51 Mon Sep 17 00:00:00 2001 From: Jimmy Chevanne Date: Fri, 12 Jan 2024 10:23:24 +0100 Subject: [PATCH] maj role zabbix srv : rendre idempottent le playbook --- roles/zabbix-srv/tasks/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/zabbix-srv/tasks/main.yml b/roles/zabbix-srv/tasks/main.yml index 01e0427..87feaec 100644 --- a/roles/zabbix-srv/tasks/main.yml +++ b/roles/zabbix-srv/tasks/main.yml @@ -53,7 +53,14 @@ login_unix_socket: /var/run/mysqld/mysqld.sock - name: 9. Importer le schema initial - shell: zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -ppassword zabbix + community.mysql.mysql_db: + state: import + name: zabbix + encoding: utf8mb4 + login_user: zabbix + login_password: password + target: /usr/share/zabbix-sql-scripts/mysql/server.sql.gz + login_unix_socket: /var/run/mysqld/mysqld.sock - name: 10. Modifier la variable pour le schema community.mysql.mysql_variables: