mirror of
https://github.com/BreizhHardware/cours-ISEN-MD.git
synced 2026-01-18 16:47:24 +01:00
Obisidian vault auto-backup: 12-01-2026 11:17:24 on . 3 files edited
This commit is contained in:
8
.obsidian/workspace.json
vendored
8
.obsidian/workspace.json
vendored
@@ -13,7 +13,7 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "ISEN/Cloud Computing/CIPA4/TP 3 Ansible.md",
|
||||
"file": "ISEN/Cloud Computing/CIPA4/TP 4 Ansible.md",
|
||||
"mode": "source",
|
||||
"source": false,
|
||||
"backlinks": true,
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "TP 3 Ansible"
|
||||
"title": "TP 4 Ansible"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -206,8 +206,9 @@
|
||||
},
|
||||
"active": "e11a6a080eb83632",
|
||||
"lastOpenFiles": [
|
||||
"ISEN/Cloud Computing/CIPA4/Cloud Computing Cours 1.md",
|
||||
"ISEN/Cloud Computing/CIPA4/TP 3 Ansible.md",
|
||||
"ISEN/Cloud Computing/CIPA4/TP 4 Ansible.md",
|
||||
"ISEN/Cloud Computing/CIPA4/Cloud Computing Cours 1.md",
|
||||
"ISEN/Cloud Computing/CIPA4/TP 2 Ansible.md",
|
||||
"ISEN/Cloud Computing/CIPA4/TP 1 Ansible.md",
|
||||
"ISEN/Réunion/CIPA 4/Réunion 8 janv 2026.md",
|
||||
@@ -242,7 +243,6 @@
|
||||
"ISEN/Réseau/A2/CCNA Cours 3.md",
|
||||
"Elevator.md",
|
||||
"ISEN/JAVA/CIPA4/TP/TP2/TP2.md",
|
||||
"ISEN/FHS/A1/Réunion stage associatif.md",
|
||||
"Pasted image 20251009192656.png",
|
||||
"src/Pasted image 20240130111505.png",
|
||||
"src/Pasted image 20240123120819.png",
|
||||
|
||||
@@ -67,4 +67,63 @@ mdp : moutarde42
|
||||
requirements: /root/demo-flask/requirements.txt
|
||||
- name: Start the flask application in background
|
||||
shell: "nohup /root/demo-flask/start.sh &"
|
||||
```
|
||||
|
||||
### Step5
|
||||
```Yaml
|
||||
---
|
||||
- hosts: demo
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: Installer le paquet git
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
- name: Cloner mon application Flask
|
||||
git:
|
||||
repo: 'https://github.com/arnaudmorin/demo-flask.git'
|
||||
dest: /root/demo-flask
|
||||
- name: Installer pip
|
||||
apt:
|
||||
name: python3-pip
|
||||
state: present
|
||||
- name: Installer les dépendances Flask
|
||||
pip:
|
||||
requirements: /root/demo-flask/requirements.txt
|
||||
- name: Démarrer l'application Flask en arrière-plan
|
||||
shell: "nohup /root/demo-flask/start.sh &"
|
||||
|
||||
|
||||
- hosts: localhost
|
||||
become: yes
|
||||
vars:
|
||||
proxy_port: 80
|
||||
flask_port: 8080
|
||||
server_name: "135.125.246.84"
|
||||
tasks:
|
||||
- name: Installer Nginx
|
||||
apt:
|
||||
name: nginx
|
||||
state: present
|
||||
- name: Configurer Nginx comme reverse proxy
|
||||
template:
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/sites-available/demo
|
||||
notify: Restart Nginx
|
||||
- name: Activer la configuration du site
|
||||
file:
|
||||
src: /etc/nginx/sites-available/demo
|
||||
dest: /etc/nginx/sites-enabled/demo
|
||||
state: link
|
||||
notify: Restart Nginx
|
||||
- name: Afficher l'URL d'accès au site
|
||||
debug:
|
||||
msg: "Votre application est accessible à l'URL : http://{{ server_name }}"
|
||||
|
||||
|
||||
handlers:
|
||||
- name: Restart Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
```
|
||||
129
ISEN/Cloud Computing/CIPA4/TP 4 Ansible.md
Normal file
129
ISEN/Cloud Computing/CIPA4/TP 4 Ansible.md
Normal file
@@ -0,0 +1,129 @@
|
||||
#CIPA4 #CloudComputing #DP #Ansible #TP
|
||||
## TP 4
|
||||
```Bash
|
||||
ssh root@135.125.246.84
|
||||
```
|
||||
mdp : moutarde42
|
||||
|
||||
### Step2
|
||||
```yml
|
||||
---
|
||||
- hosts: demo
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: Install the git package
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
- name: Clone my flask application
|
||||
git:
|
||||
repo: 'https://github.com/arnaudmorin/demo-flask.git'
|
||||
dest: /root/demo-flask
|
||||
```
|
||||
|
||||
### Step3
|
||||
```yaml
|
||||
---
|
||||
- hosts: demo
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: Install the git package
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
- name: Clone my flask application
|
||||
git:
|
||||
repo: 'https://github.com/arnaudmorin/demo-flask.git'
|
||||
dest: /root/demo-flask
|
||||
- name: Install pip
|
||||
apt:
|
||||
name: python3-pip
|
||||
state: present
|
||||
- name: Install flask requirements
|
||||
pip:
|
||||
requirements: /root/demo-flask/requirements.txt
|
||||
```
|
||||
|
||||
### Step4
|
||||
```yaml
|
||||
---
|
||||
- hosts: demo
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: Install the git package
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
- name: Clone my flask application
|
||||
git:
|
||||
repo: 'https://github.com/arnaudmorin/demo-flask.git'
|
||||
dest: /root/demo-flask
|
||||
- name: Install pip
|
||||
apt:
|
||||
name: python3-pip
|
||||
state: present
|
||||
- name: Install flask requirements
|
||||
pip:
|
||||
requirements: /root/demo-flask/requirements.txt
|
||||
- name: Start the flask application in background
|
||||
shell: "nohup /root/demo-flask/start.sh &"
|
||||
```
|
||||
|
||||
### Step5
|
||||
```Yaml
|
||||
---
|
||||
- hosts: demo
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: Installer le paquet git
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
- name: Cloner mon application Flask
|
||||
git:
|
||||
repo: 'https://github.com/arnaudmorin/demo-flask.git'
|
||||
dest: /root/demo-flask
|
||||
- name: Installer pip
|
||||
apt:
|
||||
name: python3-pip
|
||||
state: present
|
||||
- name: Installer les dépendances Flask
|
||||
pip:
|
||||
requirements: /root/demo-flask/requirements.txt
|
||||
- name: Démarrer l'application Flask en arrière-plan
|
||||
shell: "nohup /root/demo-flask/start.sh &"
|
||||
|
||||
|
||||
- hosts: localhost
|
||||
become: yes
|
||||
vars:
|
||||
proxy_port: 80
|
||||
flask_port: 8080
|
||||
server_name: "135.125.246.84"
|
||||
tasks:
|
||||
- name: Installer Nginx
|
||||
apt:
|
||||
name: nginx
|
||||
state: present
|
||||
- name: Configurer Nginx comme reverse proxy
|
||||
template:
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/sites-available/demo
|
||||
notify: Restart Nginx
|
||||
- name: Activer la configuration du site
|
||||
file:
|
||||
src: /etc/nginx/sites-available/demo
|
||||
dest: /etc/nginx/sites-enabled/demo
|
||||
state: link
|
||||
notify: Restart Nginx
|
||||
- name: Afficher l'URL d'accès au site
|
||||
debug:
|
||||
msg: "Votre application est accessible à l'URL : http://{{ server_name }}"
|
||||
|
||||
|
||||
handlers:
|
||||
- name: Restart Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
```
|
||||
Reference in New Issue
Block a user