maj AP
This commit is contained in:
parent
fa3a3a8731
commit
9bdbe30539
14
sio2/AP/apbase.yml
Normal file
14
sio2/AP/apbase.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- name: apbase
|
||||||
|
hosts: web
|
||||||
|
|
||||||
|
- name: Installer les paquets apache2 php adminer
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- apache2
|
||||||
|
- php
|
||||||
|
- adminer
|
||||||
|
- php-mbstring
|
||||||
|
- state: present
|
||||||
|
|
||||||
|
|
49
sio2/AP/apdb.yml
Normal file
49
sio2/AP/apdb.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
- name: apbase
|
||||||
|
hosts: web
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: 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: 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
|
||||||
|
|
||||||
|
# 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/
|
||||||
|
|
||||||
|
- name: Restore database
|
||||||
|
community.mysql.mysql_db:
|
||||||
|
name: sdis2023
|
||||||
|
state: import
|
||||||
|
target: /tmp/sdis2023
|
||||||
|
|
||||||
|
#- name: Restore d
|
||||||
|
#community.mysql.mysql_db:
|
||||||
|
#name: my_db
|
||||||
|
#state: import
|
||||||
|
#target: /tmp/dump.sql.bz2
|
||||||
|
#force: true
|
||||||
|
|
||||||
|
|
10
sio2/AP/apdbdump.yml
Normal file
10
sio2/AP/apdbdump.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- name: apdbdump
|
||||||
|
hosts: web
|
||||||
|
|
||||||
|
- name: 1. recuperation de sdis2023.sql avec fetch
|
||||||
|
ansible.builtin.fetch:
|
||||||
|
src: /tmp/sdis2023.sql
|
||||||
|
dest: ~/ansible/backup/
|
||||||
|
flat: yes
|
||||||
|
|
2
sio2/AP/hosts
Normal file
2
sio2/AP/hosts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[web]
|
||||||
|
ap33prod
|
21610
sio2/AP/sdis2023.sql
Normal file
21610
sio2/AP/sdis2023.sql
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user