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 - name: apbase
hosts: web hosts: web
tasks:
- name: Installer les paquets apache2 php adminer - name: Installer les paquets apache2 php et adminer
apt: apt:
name: name:
- apache2 - apache2
- php - php
- adminer - adminer
- php-mbstring - php-mbstring
- state: present state: present

View File

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