From b5764c3353f240a190a0f75e9662d67a3e0d4fcc Mon Sep 17 00:00:00 2001
From: poulpe <poulpe@localhost.localdomain>
Date: Mon, 10 Apr 2023 18:25:50 +0200
Subject: [PATCH] [Update] Add comments

---
 Config_H1_Ping_H2.yml |  5 ++++-
 Config_Wireguard.yml  | 10 +++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/Config_H1_Ping_H2.yml b/Config_H1_Ping_H2.yml
index ab3e694..df24f9e 100644
--- a/Config_H1_Ping_H2.yml
+++ b/Config_H1_Ping_H2.yml
@@ -3,11 +3,12 @@
   hosts: all
   become: true
   tasks:    
+# Load all variables in the playbook
     - name: Load the variables
       include_vars: variables.yml
     - name: Rename hosts
       command: hostnamectl set-hostname {{ inventory_hostname }}
-
+# For all host we config network interfaces
 - name: Setup network for Hosts
   hosts: hotes
   become: yes
@@ -25,6 +26,7 @@
       state: restarted
       enabled: yes
 
+# For all routers we config network interfaces
 - name: Setup network for Routers
   hosts: routeurs
   become: yes
@@ -49,6 +51,7 @@
         state: restarted
         enabled: yes
 
+# make the test
 - name: Display ping value
   hosts: H1
   become: yes
diff --git a/Config_Wireguard.yml b/Config_Wireguard.yml
index b739474..24b8da0 100644
--- a/Config_Wireguard.yml
+++ b/Config_Wireguard.yml
@@ -4,6 +4,7 @@
   hosts: all
   become: true
   
+  # Load all variables in the playbook
   tasks:
     - name: Load the variables
       include_vars: variables.yml
@@ -14,6 +15,7 @@
     - name: Rename hosts
       command: hostnamectl set-hostname {{ inventory_hostname }}
     
+# For all host we config network interfaces
 - name: Setup network for Hosts
   hosts: hotes
   become: yes
@@ -31,6 +33,7 @@
         state: restarted
         enabled: yes
 
+# For all routers we config network interfaces
 - name: Setup network for Routers
   hosts: routeurs
   become: yes
@@ -54,6 +57,7 @@
         state: restarted
         enabled: yes
 
+# Install somes program on host so install route for internet and install program and finally remove route
 - name: Install all needed program
   hosts: hotes
   become: true
@@ -61,14 +65,12 @@
     - name: Give internet to host
       ansible.builtin.shell:
         cmd: "ip r add default nexthop via 10.0.2.2"
-      # check_mode: yes
       
     - name: Install update for install other programs
       ansible.builtin.apt:
         cache_valid_time: 86400
         upgrade: yes
         update_cache: yes
-      # check_mode: yes
 
     - name: Install nginx
       ansible.builtin.apt:
@@ -83,6 +85,7 @@
       ansible.builtin.shell:
         cmd: "ip r del default"
         
+# Push in the web server the config for wireguard, nginx and the HTML for web index
 - name: Setup index.html on H2
   hosts: H2
   become: true
@@ -118,6 +121,7 @@
         state: restarted
         enabled: yes
 
+# Setup the wireguard tunnel for H1 and make all the tests
 - name: Setup wireguard on H1
   hosts: H1
   become: true
@@ -127,7 +131,7 @@
         src: ./templates/wireguard_config_template_H1.j2
         dest: /etc/wireguard/wg0.conf
         mode: 0640
-        
+
     - name: wg-quick
       ansible.builtin.shell:
         cmd: "wg-quick up wg0 2>/dev/null"
-- 
GitLab