Compare commits

..

6 Commits

Author SHA1 Message Date
fe0629d1c3 fix: needed resolv.conf from last commit 2023-03-29 16:41:18 +02:00
1371b6b970 fix: nfs share working now 2023-03-29 16:34:50 +02:00
2bffbbedc0 nagios parents 2023-03-29 14:57:11 +02:00
272ef9ac07 modification 2023-02-07 17:02:52 +01:00
81478df279 modif 2023-02-03 09:51:32 +01:00
75126890b3 incrémentation des modif 2023-02-03 09:37:13 +01:00
21 changed files with 128 additions and 29 deletions

View File

@ -1,3 +1,5 @@
# -*- shell-script -*-
@def $DEV_VPN= wg0;
table filter {
@ -10,22 +12,23 @@ table filter {
# allow local connections
interface lo ACCEPT;
interface $DEV_VPN{
# respond to ping
proto icmp icmp-type echo-request ACCEPT;
# disallow ssh
proto tcp dport ssh ACCEPT;
saddr proto tcp dport ssh DROP;
}
}#FIN INPUT
# outgoing connections are not limited
chain OUTPUT {
policy ACCEPT;
interface $DEV_VPN{
# allow ssh
proto tcp dport ssh DROP;
daddr proto tcp dport ssh ACCEPT;
# respond to ping
proto icmp icmp-type echo-request ACCEPT;
}
}#FIN OUTPUT
chain FORWARD {

View File

@ -4,7 +4,7 @@
@def $DEV_PRIVATE = enp0s8;
@def $DEV_WORLD = enp0s9;
@def $DEV_VPN= wg0;
@def $NET_PRIVATE = 172.16.0.0/24;
table filter {
@ -33,23 +33,33 @@ table filter {
# we provide DNS and SMTP services for the internal net
interface $DEV_PRIVATE saddr $NET_PRIVATE {
proto (udp tcp) dport domain ACCEPT;
proto udp dport bootps ACCEPT;
proto udp dport bootps ACCEPT;
}
# interface réseau
# interface réseau
interface $DEV_WORLD {
}
# the rest is dropped by the above policy
}#FIN INPUT
# outgoing connections are not limited
chain OUTPUT policy ACCEPT;
chain OUTPUT {policy ACCEPT;
}#FIN OUTPUT
chain FORWARD {
policy ACCEPT;
interface $DEV_VPN{
# respond to ping
proto icmp icmp-type echo-request ACCEPT;
# disallow ssh
saddr($DEV_VPN) proto tcp dport ssh DROP;
# allow ssh
daddr($DEV_VPN) proto tcp dport ssh ACCEPT;
}
# connection tracking
mod state state INVALID DROP;
mod state state (ESTABLISHED RELATED) ACCEPT;

View File

@ -4,7 +4,7 @@
@def $DEV_PRIVATE = enp0s9;
@def $DEV_WORLD = enp0s8;
@def $DEV_VPN= wg0;
@def $NET_PRIVATE = 172.16.0.0/24;
table filter {
@ -34,7 +34,12 @@ table filter {
proto (udp tcp) dport domain ACCEPT;
proto udp dport bootps ACCEPT;
}
interface $DEV_VPN{
# respond to ping
proto icmp icmp-type echo-request ACCEPT;
# disallow ssh
saddr proto tcp dport ssh ACCEPT;
}
# interface réseau
interface $DEV_WORLD {
@ -44,8 +49,14 @@ table filter {
}#FIN INPUT
# outgoing connections are not limited
chain OUTPUT policy ACCEPT;
chain OUTPUT {policy ACCEPT;
interface $DEV_VPN{
# allow ssh
daddr proto tcp dport ssh DROP;
# respond to ping
proto icmp icmp-type echo-request ACCEPT;
}
}
chain FORWARD {
policy ACCEPT;

View File

@ -13,16 +13,3 @@
apt:
name: nfs-common
state: present
- name: montage nfs pour word press
blockinfile:
path: /etc/fstab
block: |
192.168.102.253:/home/wordpress /var/www/html nfs soft,timeo=5,intr,rsize=8192,wsize=8192,wsize=8192 0 0
#- name: monte export wordpress
# ansible.posix.mount:
# path: /var/www/html
# state: mounted
# fstype: nfs
# src: 192.168.102.253:/exports/wordpress

View File

@ -26,6 +26,7 @@ define host {
host_name localhost
alias localhost
address 127.0.0.1
parents r-int
}

View File

@ -9,5 +9,6 @@ define host{
host_name s-adm
alias debian-servers
address 192.168.99.99
parents r-int
}

View File

@ -9,5 +9,6 @@ define host{
host_name s-appli
alias debian-servers
address 172.16.0.3
parents r-int
}

View File

@ -9,5 +9,6 @@ define host{
host_name s-backup
alias serveur proxy
address 172.16.0.4
parents r-int
}

View File

@ -9,6 +9,7 @@ define host{
host_name s-fog
alias serveur proxy
address 172.16.0.16
parents r-int
}

View File

@ -9,5 +9,6 @@ define host{
host_name s-infra
alias debian-servers
address 172.16.0.1
parents r-int
}

View File

@ -9,6 +9,7 @@ define host{
host_name s-itil
alias serveur proxy
address 172.16.0.9
parents r-int
}

View File

@ -9,5 +9,6 @@ define host{
host_name s-nxc
alias debian-servers
address 172.16.0.7
parents r-int
}

View File

@ -9,6 +9,7 @@ define host{
host_name s-proxy
alias serveur proxy
address 172.16.0.2
parents r-int
}

View File

@ -9,6 +9,7 @@ define host{
host_name s-win
alias serveur proxy
address 172.16.0.6
parents r-int
}

7
roles/post-lb/README.md Normal file
View File

@ -0,0 +1,7 @@
# Rôle Post
Le rôle "post" copie la configuration des interfaces des cartes réseaux nécessaires selon la machine sur laquelle on exécute le rôle. Il place cette configuration dans /etc/network/interfaces.
Ensuite, on copie le fichier "resolv.conf" dans /etc/ lorsque que la machine qui exécute le rôle n'est pas "s-adm", "s-proxy" ou "r-vp2".
Cependant, si la machine qui exécute le rôle est "s-proxy", on copie le fichier "resolv.conf.s-proxy" dans /etc/resolv.conf

View File

@ -0,0 +1,21 @@
### 0.2 - putconf - jeudi 7 janvier 2016, 16:18:49 (UTC+0100)
# The loopback network interface
auto lo
iface lo inet loopback
# carte n-adm
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.99.101/24
# Réseau n-dmz-lb
allow-hotplug enp0s8
iface enp0s8 inet static
address 192.168.101.1/24
# réseau n-dmz-db
allow-hotplug enp0s9
iface enp0s9 inet static
address 192.168.102.1/24
post-up mount -o rw 192.168.102.253:/home/wordpress /var/www/html

View File

@ -0,0 +1,21 @@
### 0.2 - putconf - jeudi 7 janvier 2016, 16:18:49 (UTC+0100)
# The loopback network interface
auto lo
iface lo inet loopback
# carte n-adm
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.99.101/24
# Réseau n-dmz-lb
allow-hotplug enp0s8
iface enp0s8 inet static
address 192.168.101.1/24
# réseau n-dmz-db
allow-hotplug enp0s9
iface enp0s9 inet static
address 192.168.102.1/24
post-up mount -o rw 192.168.102.253:/home/wordpress /var/www/html

View File

@ -0,0 +1,4 @@
search gsb.lan
domain gsb.lan
nameserver 172.16.0.1

View File

@ -0,0 +1,24 @@
---
- name: Copie interfaces
copy: src=interfaces.{{ ansible_hostname }} dest=/etc/network/interfaces
- name: Copie resolv.conf
copy: src=resolv.conf dest=/etc/
when: ansible_hostname != "s-adm" and ansible_hostname != "s-proxy"
- name: pas de chgt resolv.conf pour r-vp2
meta: end_play
when: ansible_hostname == "r-vp2"
- name: Copie resolv.conf pour s-proxy
copy: src=resolv.conf.s-proxy dest=/etc/resolv.conf
when: ansible_hostname == "s-proxy"
#- name: Confirm
# prompt: "<Entree> pour redemarrer ..."
#- name: Reboot
# shell: reboot

View File

@ -4,7 +4,7 @@
roles:
- base
- post
- post-lb
- lb-web
- snmp-agent
- ssh-cli

View File

@ -4,7 +4,8 @@
roles:
- base
- post
- post-lb
- lb-web
- snmp-agent
- ssh-cli