71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
- name: 1. Récupérer les dépots de zabbix
|
|
get_url:
|
|
url: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb
|
|
dest: /tmp
|
|
|
|
- name: 2. Installer les depots
|
|
apt:
|
|
deb: "/tmp/zabbix-release_6.4-1+debian12_all.deb"
|
|
state: present
|
|
|
|
- name: 3. Lancer un apt update
|
|
apt:
|
|
update_cache: yes
|
|
|
|
- name: 4. Installer les paquets de zabbix et mariadb
|
|
apt:
|
|
name:
|
|
- zabbix-server-mysql
|
|
- zabbix-frontend-php
|
|
- zabbix-apache-conf
|
|
- zabbix-sql-scripts
|
|
- zabbix-agent
|
|
- mariadb-server
|
|
- python3-pymysql
|
|
state: present
|
|
|
|
- name: 5. s'assurer que mariadb est en fonctionnement
|
|
service:
|
|
name: mariadb
|
|
state: started
|
|
|
|
- name: 6. Modifier la variable trust function creators pour importer la base données
|
|
community.mysql.mysql_variables:
|
|
variable: log_bin_trust_function_creators
|
|
value: 1
|
|
mode: global
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
|
|
- name: 7. Importer la base de données
|
|
community.mysql.mysql_db:
|
|
state: import
|
|
name: zabbix
|
|
encoding: utf8mb4
|
|
target: http://s-adm.gsb.adm/gsbstore/zabbix.sql.gz
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
|
|
- name: 8. Remettre a zero la variable trust function creators
|
|
community.mysql.mysql_variables:
|
|
variable: log_bin_trust_function_creators
|
|
value: 0
|
|
mode: global
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
|
|
- name: 9. Lancer le service zabbix-server
|
|
service:
|
|
name: zabbix-server
|
|
state: restarted
|
|
enabled: yes
|
|
|
|
- name: 10. Lancer le service zabbix-agent
|
|
service:
|
|
name: zabbix-agent
|
|
state: restarted
|
|
enabled: yes
|
|
|
|
- name: 11. Lancer le service apache2
|
|
service:
|
|
name: apache2
|
|
state: restarted
|
|
enabled: yes
|