50 lines
1.0 KiB
YAML
50 lines
1.0 KiB
YAML
---
|
|
- name: "MYSQL - update cache"
|
|
apt:
|
|
update_cache: yes
|
|
|
|
- name: "MYSQL - installation"
|
|
apt:
|
|
name: mariadb-server
|
|
state: latest
|
|
|
|
- name: "PYTHON3 - installation"
|
|
apt:
|
|
name: python3-pymysql
|
|
state: latest
|
|
|
|
- name: "MYSQL - démarrage de mysql"
|
|
service:
|
|
name: "mysqld"
|
|
state: started
|
|
enabled: yes
|
|
|
|
- name: "MYSQL - creation base de données"
|
|
community.mysql.mysql_db:
|
|
name: sdis29
|
|
state: present
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
check_implicit_admin: yes
|
|
|
|
- name: "MYSQL - creation utilisateur"
|
|
mysql_user:
|
|
name: "dev"
|
|
password: "Azerty1+"
|
|
priv: "*.*:ALL"
|
|
host: "localhost"
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
|
|
- name: copie de la base de donnée
|
|
copy:
|
|
src: ~/sauvegarde/sql/sdis29-dump.sql
|
|
dest: /tmp/
|
|
|
|
- name: Importation de la base de données
|
|
mysql_db:
|
|
name: sdis29
|
|
state: import
|
|
target: /tmp/sdis29.sql
|
|
login_user: dev
|
|
login_password: Azerty1+
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|