sdis29-3/ansible/apdb.yml

35 lines
901 B
YAML

---
- hosts: all
become: yes
tasks:
- name: installation de python3
apt:
name: python3-pymysql
- name: creation de la base de donnees "sdis29"
community.mysql.mysql_db:
name: sdis29
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name: Creation d'un utilisateur avec tous les privileges
community.mysql.mysql_user:
name: admin
password: password123*
priv: '*.*:ALL'
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name: copie du dump mysql sur la machine pt
copy:
src: sdis29.sql
dest: /tmp
- name: Import du fichier sdis29.sql sur la base de données sdis29
community.mysql.mysql_db:
name: sdis29
state: import
target: /tmp/sdis29.sql
force: true
login_unix_socket: /run/mysqld/mysqld.sock