maj zabbix-srv

This commit is contained in:
flo 2024-01-25 09:51:35 +01:00
parent b27ce2a372
commit 2606cd19b0

View File

@ -29,65 +29,41 @@
name: mariadb name: mariadb
state: started state: started
- name: 6. Créer la base de données - name: 6. Modifier la variable trust function creators pour importer la base données
community.mysql.mysql_db:
name: zabbix
encoding: utf8mb4
collation: utf8mb4_bin
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: 7. Creer un utilisateur et lui attribuer tous les droits
community.mysql.mysql_user:
name: zabbix
password: password
priv: '*.*:ALL,GRANT'
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: 8. Modifier une variable pour importer un schema
community.mysql.mysql_variables: community.mysql.mysql_variables:
variable: log_bin_trust_function_creators variable: log_bin_trust_function_creators
value: 1 value: 1
mode: global mode: global
login_unix_socket: /var/run/mysqld/mysqld.sock login_unix_socket: /var/run/mysqld/mysqld.sock
- name: 9. Importer le schema initial - name: 7. Importer la base de données
community.mysql.mysql_db: community.mysql.mysql_db:
state: import state: import
name: zabbix name: zabbix
encoding: utf8mb4 encoding: utf8mb4
login_user: zabbix target: http://s-adm.gsb..adm/gsbstore/zabbix.sql.gz
login_password: password
target: /usr/share/zabbix-sql-scripts/mysql/server.sql.gz
login_unix_socket: /var/run/mysqld/mysqld.sock login_unix_socket: /var/run/mysqld/mysqld.sock
- name: 10. Modifier la variable pour le schema - name: 8. Remettre a zero la variable trust function creators
community.mysql.mysql_variables: community.mysql.mysql_variables:
variable: log_bin_trust_function_creators variable: log_bin_trust_function_creators
value: 0 value: 0
mode: global mode: global
login_unix_socket: /var/run/mysqld/mysqld.sock login_unix_socket: /var/run/mysqld/mysqld.sock
- name: 11. Configurer le mdp de la db - name: 9. Lancer le service zabbix-server
replace:
path: /etc/zabbix/zabbix_server.conf
regexp: '^# DBPassword='
replace: 'DBPassword=password'
- name: 12. Lancer le service zabbix-server
service: service:
name: zabbix-server name: zabbix-server
state: restarted state: restarted
enabled: yes enabled: yes
- name: 13. Lancer le service zabbix-agent - name: 10. Lancer le service zabbix-agent
service: service:
name: zabbix-agent name: zabbix-agent
state: restarted state: restarted
enabled: yes enabled: yes
- name: 14. Lancer le service apache2 - name: 11. Lancer le service apache2
service: service:
name: apache2 name: apache2
state: restarted state: restarted