Ajout du 2ème playbook
This commit is contained in:
parent
ffc05b69bc
commit
47472f2d25
34
Ansible/apdb.yml
Normal file
34
Ansible/apdb.yml
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
- 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
|
Loading…
x
Reference in New Issue
Block a user