sdis29-2/ansible/apdb.yml
Your Name 8b53ad8ad7 modified: apdb.yml
modified:   apdbdump.yml
	new file:   sdis29.sql
2024-11-08 11:23:49 +01:00

39 lines
732 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: my_db
state: import
target: /tmp/sdis29.sql
login_unix_socket: /run/mysqld/mysqld.sock