Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
8183dae78d | |||
9a85d79e62 | |||
afe67b5e02 | |||
2f637d51dc | |||
bfae3b4392 | |||
fa6a599a2e |
18
Partie2/Wireguard/srvlog31/wg0.conf
Normal file
18
Partie2/Wireguard/srvlog31/wg0.conf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#Fichier wg0-a.conf
|
||||||
|
# local settings for Endpoint A
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = iD/nJRCNKIVrCjJQh8ay49jaWuo/WF7iXylGg6GvwmI=
|
||||||
|
Address = 10.0.0.1/32
|
||||||
|
ListenPort = 51820
|
||||||
|
|
||||||
|
# remote settings for Endpoint B
|
||||||
|
[Peer]
|
||||||
|
PublicKey = O1jQuesiC2HEP2Sght/usrjV7KtqF+JLHJ77JhsMPDY=
|
||||||
|
Endpoint = 172.16.0.95:51820
|
||||||
|
AllowedIPs = 10.0.0.2/32
|
||||||
|
|
||||||
|
# remote settings for Endpoint C
|
||||||
|
[Peer]
|
||||||
|
PublicKey = K78Gxh0wHPPPbQxJg8JpbOsS9dRLrG2AqZcCs3W2UR0=
|
||||||
|
Endpoint = 172.16.0.82:51820
|
||||||
|
AllowedIPs = 10.0.0.3/32
|
18
Partie2/ansible/apbase.yml
Normal file
18
Partie2/ansible/apbase.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
- name: install ap et bd
|
||||||
|
#hosts: ap31-prod, ap31-test
|
||||||
|
#hosts: ap31-prodt
|
||||||
|
hosts: all
|
||||||
|
# become_method: sudo
|
||||||
|
# remote_user: debian
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: install apache2, php, mariadb-server, python3-pymysql
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
|
- apache2
|
||||||
|
- php
|
||||||
|
- mariadb-server
|
||||||
|
- python3-pymysql
|
||||||
|
state: present
|
32
Partie2/ansible/apdb.yml
Normal file
32
Partie2/ansible/apdb.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- name: Creer la BDD, creer les comptes et injecter la BDD
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: creation de la BDD sdis29-1
|
||||||
|
community.mysql.mysql_db:
|
||||||
|
name: sdis29-1
|
||||||
|
state: present
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
|
||||||
|
- name: copie de la base de donnees
|
||||||
|
copy:
|
||||||
|
src: sdis2023.sql
|
||||||
|
dest: /tmp
|
||||||
|
|
||||||
|
- name: restauration de la base de donnees
|
||||||
|
community.mysql.mysql_db:
|
||||||
|
name: sdis29-1
|
||||||
|
state: import
|
||||||
|
target: /tmp/sdis2023.sql
|
||||||
|
force: true
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
|
||||||
|
- name: creation de lutilisateur slam
|
||||||
|
community.mysql.mysql_user:
|
||||||
|
name: slam
|
||||||
|
password: Azerty1+
|
||||||
|
priv: '*.*:ALL,GRANT'
|
||||||
|
state: present
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
12
Partie2/ansible/apdbdump.yml
Normal file
12
Partie2/ansible/apdbdump.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
- name: recuperer localement un dump de la BDD distante
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Copie du dump distant
|
||||||
|
ansible.builtin.fetch:
|
||||||
|
src: /tmp/sdis2023.sql
|
||||||
|
dest: /root/sauvegarde/sql/
|
||||||
|
flat: true
|
||||||
|
|
2
Partie2/ansible/hosts
Normal file
2
Partie2/ansible/hosts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ap31-prodt
|
||||||
|
|
Reference in New Issue
Block a user