Compare commits

...

2 Commits

Author SHA1 Message Date
79c7bd34e6 Maj lb-front 2023-01-20 09:46:08 +01:00
0cd9f1bb4c Correction fichier interface 2023-01-20 09:38:46 +01:00
3 changed files with 32 additions and 25 deletions

View File

@ -1,11 +1,25 @@
--- - name: install haproxy
- name: Installation d'HAproxy apt:
apt: pkg=haproxy state=present update_cache=yes name: haproxy
state: present
- name: Fichier de configuration - name: parametre backend et fontend
copy: src=haproxy.cfg dest=/etc/haproxy/haproxy.cfg blockinfile:
notify: path: /etc/haproxy/haproxy.cfg
- restart haproxy block: |
frontend proxypublic
bind 192.168.56.2:80
default_backend fermeweb
backend fermeweb
balance roundrobin
option httpclose
#option httpchk HEAD / HTTP/1.0
server web1.test 192.168.56.3:80 check
#server web2.test 192.168.56.4:80 check
- name: Copie de goss - name: redemarre haproxy
copy: src=goss.yaml dest=/root service:
name: haproxy
state: restarted
enabled: yes

View File

@ -8,37 +8,30 @@ iface lo inet loopback
# Reseau N-adm # Reseau N-adm
allow-hotplug enp0s3 allow-hotplug enp0s3
iface enp0s3 inet static iface enp0s3 inet static
address 192.168.99.12 address 192.168.99.12/24
netmask 255.255.255.0
# Reseau liaison avec r-ext # Reseau liaison avec r-ext
allow-hotplug enp0s8 allow-hotplug enp0s8
iface enp0s8 inet static iface enp0s8 inet static
address 192.168.200.254 address 192.168.200.254/24
netmask 255.255.255.0
gateway 192.168.200.253 gateway 192.168.200.253
up ip route add default via 192.168.200.253
# Reseau wifi # Reseau wifi
allow-hotplug enp0s9 allow-hotplug enp0s9
iface enp0s9 inet static iface enp0s9 inet static
address 172.16.65.254 address 172.16.65.254/24
netmask 255.255.255.0
# Reseau user # Reseau user
allow-hotplug enp0s10 allow-hotplug enp0s10
iface enp0s10 inet static iface enp0s10 inet static
address 172.16.64.254 address 172.16.64.254/24
netmask 255.255.255.0
# Reseau infra # Reseau infra
allow-hotplug enp0s16 allow-hotplug enp0s16
iface enp0s16 inet static iface enp0s16 inet static
address 172.16.0.254 address 172.16.0.254/24
netmask 255.255.255.0
up /root/routagenat

View File

@ -3,11 +3,11 @@
- name: Copie du fichier sysctl.conf - name: Copie du fichier sysctl.conf
copy: src=sysctl.conf dest=/etc/ copy: src=sysctl.conf dest=/etc/
- name: copier le script de routage #- name: copier le script de routage
copy: src=routagenat dest=/root/ # copy: src=routagenat dest=/root/
- name: rendre executabe le script #- name: rendre executabe le script
shell: chmod +x /root/routagenat # shell: chmod +x /root/routagenat
#- name: exectuer le script #- name: exectuer le script
# script: /root/routagenat # script: /root/routagenat