Update README.md
This commit is contained in:
parent
4dbb5ffeb2
commit
b70c3ca97e
4 changed files with 111 additions and 7 deletions
107
README.md
107
README.md
|
@ -1,15 +1,108 @@
|
|||
# Ansible Project
|
||||
> Florian Charlaix P1905458 | DevOps 1
|
||||
|
||||
## SSH Keys
|
||||
### VM
|
||||
|
||||
### Git
|
||||
|
||||
## Roles
|
||||
*
|
||||
### APT
|
||||
Installe les dépendances générales avec APT
|
||||
* zip
|
||||
* unzip
|
||||
* acl
|
||||
|
||||
### MariaDB
|
||||
Install et configure MariaDB.
|
||||
Crée une base de données, un utilisateur et mot de passe avec les variables :
|
||||
* `db_name`: Nom de la base de données
|
||||
* `db_user`: Nom de l'utilisateur
|
||||
* `db_password`: Mot de passe de l'utilisateur
|
||||
|
||||
### PHP
|
||||
Install, configure PHP et ses dépendances pour ProjectSend.
|
||||
|
||||
### NodeJS
|
||||
Installe et met en place NodeJS et NPM.
|
||||
Cela crée aussi le dossier npm pour l'utilisateur www-data
|
||||
|
||||
### Nginx
|
||||
Install et configure Nginx. Met en place la configuration pour ProjectSend.
|
||||
* `gzip`: Activer ou non gzip
|
||||
|
||||
### ansistrano.deploy
|
||||
Ce rôle fourni par la communauté permet de gérer le déploiement atomique.
|
||||
|
||||
Il utilise les tags du GitHub afin de gérer la version.
|
||||
|
||||
Une fois installer, la configuration pour la base de données est effectué et les dépendances installer et/ou compiler grace aux taches dans `ansistrano_tasks`.
|
||||
|
||||
## Setup
|
||||
(Also makefile can be used)
|
||||
* Mettre en place les bons hosts dans `hosts.yml` et les `host_vars` correspondents
|
||||
* Exécuter le playbook principale
|
||||
```bash
|
||||
ansible-playbook playbook.yml
|
||||
```
|
||||
|
||||
## Schema
|
||||
```mermaid
|
||||
graph TB;
|
||||
subgraph Playbook
|
||||
playbook.yml --> playbook-server.yml;
|
||||
playbook.yml --> playbook-app.yml;
|
||||
end
|
||||
subgraph Roles
|
||||
playbook-server.yml --- apt(apt);
|
||||
playbook-server.yml --- mariadb(mariadb);
|
||||
playbook-server.yml --- php(php);
|
||||
playbook-server.yml --- nodejs(nodejs);
|
||||
playbook-server.yml --- nginx(nginx);
|
||||
playbook-app.yml --- ansistrano.deploy(ansistrano.deploy);
|
||||
end
|
||||
subgraph Hooks
|
||||
ansistrano.deploy --- after_update.yml([after_update.yml]);
|
||||
after_update.yml --> configure.yml([configure.yml]);
|
||||
after_update.yml --> dependencies.yml([dependencies.yml]);
|
||||
end
|
||||
```
|
||||
|
||||
## VM
|
||||
* Ip: `192.168.140.142`
|
||||
* Utilisateur: `ubuntu`
|
||||
* Clé privée :
|
||||
```
|
||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
|
||||
NhAAAAAwEAAQAAAYEAy+NU1W9VA/fxHVfs3YIqiiRdgSaQvm5H388+aE/lYZpNBmQqoFXP
|
||||
dmWKpawtmdMxj7wnQI/5+l1kBooGMQiIpNwumlNoxRCgHuTIUyNPE2d3Qr0/48AqZ80hL+
|
||||
+fgI8JmWZQSe46aPzww88eHNAqGsOhEEEtn4FSLxmOCoLLpDjb4RXmyHey0WIzTuRf6N9n
|
||||
tf1AiThD7EZhFq4cBDPzMwvuFPyx661fQsCJH3s21SUB2+6Wk7aXs9armGxydffeN2w2cx
|
||||
P+suPUummdQbg1YQW+I4f9ZT4azh0+jmhXk1JRfOXXsntEOotfQvAv2BPMyBVJN5ia6yhz
|
||||
oWp1dDD9cWtjQqzr7Iz3EttJnwp27CK/1OB/3wz6A1qDBJZa2cf2FY9wNgL7HgvrIbymSY
|
||||
Ztxsuc2Eun+8VOr7jCoW3rcQAYtz786uWau9lZ12unflTy82GbAKQqSo5PJj7R0y/EUYHE
|
||||
I2XAmC1pbeYlYfo2Ofgmw8a15ZuG8SYkWUdszjTZAAAFkAlM0cEJTNHBAAAAB3NzaC1yc2
|
||||
EAAAGBAMvjVNVvVQP38R1X7N2CKookXYEmkL5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0N6ftD+mbz3SG/I71C0Eh2AvuWvdjvE6P30+sVWuuVAAAA
|
||||
wQCx+O5YBnIAiMOwxzi83A7KmxAy/6y6KFgUK9fQWpWid+o5Jv2o/lNxrVPZJSwKshACo0
|
||||
AakUoC3agkNxziV/0IGewzjdIbe4sXz+zUx3XmbMoA4Nb7wE8dvAApf8yEUH9BOXbPPQh+
|
||||
otPeXVcdEVUZv8p+2GpfKmLCoQVlMuU2fuuntz/LN7EmM9or4PSkMG73zcsRQc9xjQm98x
|
||||
mutjzfylSZ0TgUVmuO+a1ycUy8mA5m8ITZ6VXtb4T3W3YknMcAAADBAO03mYLVitGIV9zr
|
||||
l8OR0BSatHE+BBLjLBNwKluDOECqhGDNA1EGKcP+FyJk1ZNY1wYFie1HL9GSbhM61ZT3YK
|
||||
EZU+q0mgdo8JS9WpYSNHbyaW84PtlXHa5YP/8pg4BjJAN84Qu1yGUGJ2ZnhkF9cEQ2CdGr
|
||||
NVUpSPKUpaoLxxZogr2h9wN/CxUtBjon8qWEdL1TUNK+DumRrf692AcR3jJsHWNzuNtgFQ
|
||||
JtQSrxSwVm3V41It7jERO2x83Dgb6uGwAAAMEA3Agl9Sc1sIsO9dkx/0AQoms2c4KhhQ1C
|
||||
lk/+7EeJan9/0esB+4XbMIScr2jT98mnBcn29fHC+lInxfEdeXBQ1xhNBqvFObwj2jIk/D
|
||||
I4J4dLUH5t9A4y2C0wPcDxPDF6HclAYpBPgWX1EMF/MYLv/HktSw2OLqzeuCGKXyXyZC5j
|
||||
Z0VtLnTcdrHEL0uyn4IyTdXIaCCQRw3vHONLMdbhN4qr2kxwALMKmTFmVF+Kz3Tm1aePrs
|
||||
fTx2XIokhY0wgbAAAAGXVidW50dUBwMTkwNTQ1OC1hbnNpYmxlLTEB
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
```
|
||||
|
|
4
host_vars/ubuntu.yml
Normal file
4
host_vars/ubuntu.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
ansible_host: 192.168.140.142
|
||||
ansible_user: ubuntu
|
||||
ansible_ssh_extra_args: "-o IdentitiesOnly=yes"
|
||||
ansible_python_interpreter: /usr/bin/python3
|
4
host_vars/ubuntu1.yml
Normal file
4
host_vars/ubuntu1.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
ansible_host: 192.168.140.96
|
||||
ansible_user: ubuntu
|
||||
ansible_ssh_extra_args: "-o IdentitiesOnly=yes"
|
||||
ansible_python_interpreter: /usr/bin/python3
|
|
@ -1,2 +1,5 @@
|
|||
---
|
||||
scope: "prod"
|
||||
db_name:
|
||||
db_user:
|
||||
db_password:
|
Reference in a new issue