Nathan Genret f04324f5f6 nouveau fichier : ap32-prod/ansible/apbase.yml
nouveau fichier : ap32-prod/ansible/apdb.yml
2024-11-15 08:41:32 +01:00

39 lines
733 B
YAML

---
- hosts: all
become: true
tasks:
- name: installation extensions python
apt:
name: python3-pymysql
state: present
- name: Create a new database
community.mysql.mysql_db:
name: sdis29
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name: Create a new user
community.mysql.mysql_user:
name: admin
password: Azerty1+
priv: 'sdis29.*:ALL'
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name:
copy:
src: sdis29.sql
dest: /tmp/
- name: Import database
community.mysql.mysql_db:
name: sdis29
state: import
target: /tmp/sdis29.sql
login_unix_socket: /run/mysqld/mysqld.sock