sdis29-2/ansible/apdb.yml
Your Name 05f9b94c3c modified: apdb.yml
modified:   apdbdump.yml
	new file:   sdis29-dump.sql
2024-11-08 11:55:27 +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