53 lines
971 B
Systemverilog
53 lines
971 B
Systemverilog
- name: "[MYSQL] - update cache"
|
|
apt:
|
|
update_cache: yes
|
|
|
|
- name: "[MYSQL] - install"
|
|
apt:
|
|
name: mariadb-server
|
|
state: latest
|
|
|
|
- name: "[Python] - install"
|
|
apt:
|
|
name: python
|
|
state: latest
|
|
|
|
- name: "[Python3-mysql] - install"
|
|
apt:
|
|
name: python3-pymysql
|
|
state: latest
|
|
|
|
|
|
- name: "[MYSQL] - start mysql"
|
|
service:
|
|
name: "mysqld"
|
|
state: started
|
|
enabled: yes
|
|
|
|
- name: "[MYSQL] - create database"
|
|
community.mysql.mysql_db:
|
|
name : "sdis29"
|
|
check_implicit_admin: yes
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
state: present
|
|
|
|
- name: "[MYSQL] - create user"
|
|
mysql_user:
|
|
name: "dev"
|
|
password: "Azerty1+"
|
|
priv: "*.*:ALL"
|
|
host: "192.168.0.48"
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
|
|
|
|
- name: Copier dump
|
|
copy:
|
|
src: db-sauv.sql.gz
|
|
dest: /tmp
|
|
|
|
- name: Restorer la base de données
|
|
community.mysql.mysql_db:
|
|
name: my_db
|
|
state: import
|
|
target: /tmp/db-sauv.sql.gz
|