Compare commits
No commits in common. "3cc5c7a773c87d176ef15f3602c3c1bf9cad9532" and "d6e080d0145615056a7a0eb3d2f9e512809eb4f5" have entirely different histories.
3cc5c7a773
...
d6e080d014
@ -1,12 +1,2 @@
|
|||||||
[pt]
|
[pt]
|
||||||
ap33-pt
|
ap33-pt
|
||||||
|
|
||||||
[wg]
|
|
||||||
ap33-mon
|
|
||||||
ap33-prod
|
|
||||||
|
|
||||||
[wg_master]
|
|
||||||
ap33-mon
|
|
||||||
|
|
||||||
[wg_cli]
|
|
||||||
ap33-prod
|
|
||||||
|
@ -2,17 +2,10 @@
|
|||||||
set -u
|
set -u
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
AddressAwg=10.0.0.1/24 # Adresse VPN Wireguard extremite A
|
|
||||||
EndpointA=172.16.0.122 # Adresse extremite A
|
|
||||||
PortA=51820 # Port ecoute extremite A
|
|
||||||
AddressBwg=10.0.0.2/24 # Adresse VPN Wireguard extremite B
|
|
||||||
=======
|
|
||||||
AddressAwg=172.16.0.1/24 # Adresse VPN Wireguard extremite A
|
AddressAwg=172.16.0.1/24 # Adresse VPN Wireguard extremite A
|
||||||
EndpointA=172.16.0.122 # Adresse extremite A
|
EndpointA=172.16.0.122 # Adresse extremite A
|
||||||
PortA=51820 # Port ecoute extremite A
|
PortA=51820 # Port ecoute extremite A
|
||||||
AddressBwg=172.16.0.2/24 # Adresse VPN Wireguard extremite B
|
AddressBwg=172.16.0.2/24 # Adresse VPN Wireguard extremite B
|
||||||
>>>>>>> d6e080d0145615056a7a0eb3d2f9e512809eb4f5
|
|
||||||
EndpointB=172.16.0.121 # Adresse extremite B
|
EndpointB=172.16.0.121 # Adresse extremite B
|
||||||
PortB=51820 # Port ecoute extremite B
|
PortB=51820 # Port ecoute extremite B
|
||||||
|
|
||||||
@ -28,11 +21,7 @@ pKA=$(cat endpoint-a.pub)
|
|||||||
PKB=$(cat endpoint-b.key)
|
PKB=$(cat endpoint-b.key)
|
||||||
pKB=$(cat endpoint-b.pub)
|
pKB=$(cat endpoint-b.pub)
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
cat <<FINI > wg0-1.conf
|
|
||||||
=======
|
|
||||||
cat <<FINI > wg1-a.conf
|
cat <<FINI > wg1-a.conf
|
||||||
>>>>>>> d6e080d0145615056a7a0eb3d2f9e512809eb4f5
|
|
||||||
# local settings for Endpoint A
|
# local settings for Endpoint A
|
||||||
[Interface]
|
[Interface]
|
||||||
PrivateKey = $PKA
|
PrivateKey = $PKA
|
||||||
@ -46,11 +35,7 @@ Endpoint = ${EndpointB}:$PortB
|
|||||||
AllowedIPs = $AddressBwg
|
AllowedIPs = $AddressBwg
|
||||||
FINI
|
FINI
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
cat <<FINI > wg0-2.conf
|
|
||||||
=======
|
|
||||||
cat <<FINI > wg1-b.conf
|
cat <<FINI > wg1-b.conf
|
||||||
>>>>>>> d6e080d0145615056a7a0eb3d2f9e512809eb4f5
|
|
||||||
# local settings for Endpoint B
|
# local settings for Endpoint B
|
||||||
[Interface]
|
[Interface]
|
||||||
PrivateKey = $PKB
|
PrivateKey = $PKB
|
||||||
|
@ -1,70 +1,5 @@
|
|||||||
---
|
---
|
||||||
- hosts: wg
|
- hosts: wg
|
||||||
<<<<<<< HEAD
|
|
||||||
become: yes
|
|
||||||
tasks:
|
|
||||||
- name: arrete unattended-upgrades
|
|
||||||
service:
|
|
||||||
name: unattended-upgrades
|
|
||||||
state: stopped
|
|
||||||
|
|
||||||
- name: installe Wireguard
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- wireguard
|
|
||||||
- wireguard-tools
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- hosts: wg_master
|
|
||||||
tasks:
|
|
||||||
- name: copie le fichier wg0-1.conf et wg0-2.conf vers les machines master et cli
|
|
||||||
copy:
|
|
||||||
src: mkwgconf.sh
|
|
||||||
dest: mkwgconf.sh
|
|
||||||
|
|
||||||
- name: generations fichier configuration wireguard wg0-1.conf etc
|
|
||||||
shell: bash mkwgconf.sh
|
|
||||||
|
|
||||||
- name: récupération du fichier wg0-1.conf vers ap33-ans
|
|
||||||
fetch:
|
|
||||||
src: wg0-1.conf
|
|
||||||
dest: wg0-1.conf
|
|
||||||
flat: yes
|
|
||||||
|
|
||||||
- name: récupération du fichier wg0-2.conf vers ap33-ans
|
|
||||||
fetch:
|
|
||||||
src: wg0-2.conf
|
|
||||||
dest: wg0-2.conf
|
|
||||||
flat: yes
|
|
||||||
|
|
||||||
- hosts: wg
|
|
||||||
become: yes
|
|
||||||
tasks:
|
|
||||||
- name: copie fichier wg0-1 vers les clients
|
|
||||||
copy:
|
|
||||||
src: wg0-1.conf
|
|
||||||
dest: /etc/wireguard/wg0.conf
|
|
||||||
when: ansible_hostname == "ap33-mon"
|
|
||||||
|
|
||||||
- name: copie fichier wg0-2 vers les clients
|
|
||||||
copy:
|
|
||||||
src: wg0-2.conf
|
|
||||||
dest: /etc/wireguard/wg0.conf
|
|
||||||
when: ansible_hostname == "ap33-prod"
|
|
||||||
|
|
||||||
- hosts: wg
|
|
||||||
become: yes
|
|
||||||
tasks:
|
|
||||||
- name: Activation de wireguard
|
|
||||||
service:
|
|
||||||
name: wg-quick@wg0.service
|
|
||||||
enabled: yes
|
|
||||||
|
|
||||||
- name: Redémarre le wireguard
|
|
||||||
service:
|
|
||||||
name: wg-quick@wg0.service
|
|
||||||
state: restarted
|
|
||||||
=======
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: installe Wireguard
|
- name: installe Wireguard
|
||||||
apt:
|
apt:
|
||||||
@ -87,4 +22,3 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: copie fichier
|
- name: copie fichier
|
||||||
|
|
||||||
>>>>>>> d6e080d0145615056a7a0eb3d2f9e512809eb4f5
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user