From b70c3ca97e85445d5e088da3f8e23e75ca0b4296 Mon Sep 17 00:00:00 2001 From: flifloo Date: Wed, 18 May 2022 14:42:06 +0200 Subject: [PATCH] Update README.md --- README.md | 107 +++++++++++++++++++++++++++++--- host_vars/ubuntu.yml | 4 ++ host_vars/ubuntu1.yml | 4 ++ roles/mariadb/defaults/main.yml | 3 + 4 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 host_vars/ubuntu.yml create mode 100644 host_vars/ubuntu1.yml diff --git a/README.md b/README.md index b05d938..71c81d1 100644 --- a/README.md +++ b/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 +EAAAGBAMvjVNVvVQP38R1X7N2CKookXYEmkL5uR9/PPmhP5WGaTQZkKqBVz3ZliqWsLZnT +MY+8J0CP+fpdZAaKBjEIiKTcLppTaMUQoB7kyFMjTxNnd0K9P+PAKmfNIS/vn4CPCZlmUE +nuOmj88MPPHhzQKhrDoRBBLZ+BUi8ZjgqCy6Q42+EV5sh3stFiM07kX+jfZ7X9QIk4Q+xG +YRauHAQz8zML7hT8seutX0LAiR97Nt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ycUy8mA5m8ITZ6VXtb4T3W3YknMcAAADBAO03mYLVitGIV9zr +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----- +``` diff --git a/host_vars/ubuntu.yml b/host_vars/ubuntu.yml new file mode 100644 index 0000000..7ef573d --- /dev/null +++ b/host_vars/ubuntu.yml @@ -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 diff --git a/host_vars/ubuntu1.yml b/host_vars/ubuntu1.yml new file mode 100644 index 0000000..3344c1f --- /dev/null +++ b/host_vars/ubuntu1.yml @@ -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 diff --git a/roles/mariadb/defaults/main.yml b/roles/mariadb/defaults/main.yml index 311d0c6..1f163c0 100644 --- a/roles/mariadb/defaults/main.yml +++ b/roles/mariadb/defaults/main.yml @@ -1,2 +1,5 @@ --- scope: "prod" +db_name: +db_user: +db_password: \ No newline at end of file