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: Installation d'HAproxy
apt: pkg=haproxy state=present update_cache=yes
- name: install haproxy
apt:
name: haproxy
state: present
- name: Fichier de configuration
copy: src=haproxy.cfg dest=/etc/haproxy/haproxy.cfg
notify:
- restart haproxy
- name: parametre backend et fontend
blockinfile:
path: /etc/haproxy/haproxy.cfg
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
copy: src=goss.yaml dest=/root
- name: redemarre haproxy
service:
name: haproxy
state: restarted
enabled: yes

View File

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

View File

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