Skip to content
Snippets Groups Projects
Commit b5764c33 authored by poulpe's avatar poulpe
Browse files

[Update] Add comments

parent e2a815c1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment