correction playbook

This commit is contained in:
root 2023-11-22 13:04:40 +01:00
parent 9bdbe30539
commit 9a9122c181
2 changed files with 41 additions and 40 deletions

View File

@ -1,14 +1,14 @@
---
- name: apbase
hosts: web
- name: Installer les paquets apache2 php adminer
apt:
name:
- apache2
- php
- adminer
- php-mbstring
- state: present
tasks:
- name: Installer les paquets apache2 php et adminer
apt:
name:
- apache2
- php
- adminer
- php-mbstring
state: present

View File

@ -2,42 +2,43 @@
- name: apbase
hosts: web
become: yes
tasks:
- name: Installer mariadb
apt:
name:
- mariadb-server
- python3-PyMySQL
state: present
- name: 1. Installer mariadb
apt:
name:
- mariadb-server
- python3-PyMySQL
state: present
- name: s'assurer que mariadb est en fonctionnement
service:
name: mariadb-server
state: started
- name: 2. s'assurer que mariadb est en fonctionnement
service:
name: mariadb-server
state: started
- name: Creer un utilisateur 'admin' lui attribuer tous les droits
community.mysql.mysql_user:
name: admin
password: admin
priv: '*.*:ALL'
state: present
- name: 3. Creer un utilisateur 'admin' lui attribuer tous les droits
community.mysql.mysql_user:
name: admin
password: admin
priv: '*.*:ALL'
state: present
- name: Creation de la base de donnee 'sdis2023'
mysql_db:
name: sdis2023
state: present
- name: 4. Creation de la base de donnee 'sdis2023'
community.mysql_db.mysql_db:
name: sdis2023
state: present
# Copy database dump file to remote host and restore it to database 'sdis2023'
- name: Copie du dump de la BDD
copy:
src: sdis2023.sql
dest: /tmp/
# Copier le fichier de sauvegarde de la base de données sur l'hôte distant et le restaurer dans la base de données 'sdis2023'
- name: 5. Copie de la sauvegarde de la base de données sur l'hôte distant
copy:
src: sdis2023.sql
dest: /tmp/
- name: Restore database
community.mysql.mysql_db:
name: sdis2023
state: import
target: /tmp/sdis2023
- name: 6. Restaurer la base de données
community.mysql.mysql_db:
name: sdis2023
state: import
target: /tmp/sdis2023
#- name: Restore d
#community.mysql.mysql_db: