Compare commits
21 Commits
v0.6.e-tva
...
v0.7.d-am
Author | SHA1 | Date | |
---|---|---|---|
afdd827df3 | |||
290e2866fe | |||
dc276e2c68 | |||
6c090e61f8 | |||
1c036df5c4 | |||
a9b757dafa | |||
bb5521f0dc | |||
6201569f8a | |||
b14c35a7aa | |||
3be4dd14d4 | |||
7245538622 | |||
c448fb3457 | |||
0c0b58399f | |||
e1f0910ec7 | |||
01b41a6dd7 | |||
e36173b079 | |||
575eaea422 | |||
8ea91004f8 | |||
6844d05974 | |||
d8371a0973 | |||
4621000ce1 |
BIN
doc/pics/e4-dmz-tl.dia
Normal file
BIN
doc/pics/e4-dmz-tl.dia
Normal file
Binary file not shown.
BIN
doc/pics/e4-dmz-tl.png
Normal file
BIN
doc/pics/e4-dmz-tl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
39
goss/s-agence.yaml
Normal file
39
goss/s-agence.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
command:
|
||||
ip r:
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- default via 172.16.128.254 dev enp0s8
|
||||
- 172.16.128.0/24
|
||||
- 192.168.99.0/24
|
||||
stderr: []
|
||||
timeout: 10000
|
||||
ping -c 2 172.16.0.1:
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- 0% packet loss
|
||||
stderr: []
|
||||
timeout: 10000
|
||||
ping -c 2 172.16.128.254:
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- 0% packet loss
|
||||
stderr: []
|
||||
timeout: 10000
|
||||
ping -c 2 192.168.1.1:
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- 0% packet loss
|
||||
stderr: []
|
||||
timeout: 10000
|
||||
ping -c 2 192.168.1.2:
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- 0% packet loss
|
||||
stderr: []
|
||||
timeout: 10000
|
||||
ping -c 2 192.168.200.254:
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- 0% packet loss
|
||||
stderr: []
|
||||
timeout: 10000
|
@ -13,6 +13,7 @@
|
||||
- goss
|
||||
- dhcp-ag
|
||||
- dns-agence
|
||||
- ssh-root-access
|
||||
- snmp-agent
|
||||
- vpn-stg-l
|
||||
# - x509-l
|
||||
|
47
roles/docker-nextcloud/files/config.php
Normal file
47
roles/docker-nextcloud/files/config.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
$CONFIG = array (
|
||||
'htaccess.RewriteBase' => '/',
|
||||
'memcache.local' => '\\OC\\Memcache\\APCu',
|
||||
'apps_paths' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'path' => '/var/www/html/apps',
|
||||
'url' => '/apps',
|
||||
'writable' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'path' => '/var/www/html/custom_apps',
|
||||
'url' => '/custom_apps',
|
||||
'writable' => true,
|
||||
),
|
||||
),
|
||||
'instanceid' => 'ocvc4q2htemf',
|
||||
'passwordsalt' => 'stdJZMx4C5hz85Kqt8XdZIzx8kVOHI',
|
||||
'secret' => 'II1BBgzlx70WUYCapAt/m/Bt1ZEk/n11n0DVq3zynyU8F/bU',
|
||||
'trusted_domains' =>
|
||||
array (
|
||||
0 => '172.16.0.7:5678',
|
||||
1 => '172.16.0.7:8080',
|
||||
2 => 's-mess',
|
||||
3 => 's-mess.gsb.lan',
|
||||
4 => 'localhost:8080',
|
||||
),
|
||||
'trusted_proxies' => ['172.16.0.7'],
|
||||
'overwriteprotocol' => 'http',
|
||||
'overwritehost' => '172.16.0.7:8080',
|
||||
'proxy' => '172.16.0.7:8080',
|
||||
'datadirectory' => '/var/www/html/data',
|
||||
'dbtype' => 'mysql',
|
||||
'version' => '20.0.6.1',
|
||||
'overwrite.cli.url' => 'http://172.16.0.7:5678',
|
||||
'dbname' => 'nextcloud',
|
||||
'dbhost' => 'db',
|
||||
'dbport' => '',
|
||||
'dbtableprefix' => 'oc_',
|
||||
'mysql.utf8mb4' => true,
|
||||
'dbuser' => 'nextcloud',
|
||||
'dbpassword' => 'root',
|
||||
'installed' => true,
|
||||
);
|
@ -16,18 +16,20 @@ services:
|
||||
- MYSQL_PASSWORD=root
|
||||
- MYSQL_DATABASE=nextcloud
|
||||
- MYSQL_USER=nextcloud
|
||||
TZ: Europe/Paris
|
||||
|
||||
app:
|
||||
image: nextcloud
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:80
|
||||
- 5678:80
|
||||
links:
|
||||
- db
|
||||
volumes:
|
||||
- nextcloud:/var/www/html
|
||||
- ./nextcloud:/var/www/html
|
||||
environment:
|
||||
- MYSQL_PASSWORD=root
|
||||
- MYSQL_DATABASE=nextcloud
|
||||
- MYSQL_USER=nextcloud
|
||||
- MYSQL_HOST=db
|
||||
TZ: Europe/Paris
|
||||
|
100
roles/docker-nextcloud/files/proxy
Normal file
100
roles/docker-nextcloud/files/proxy
Normal file
@ -0,0 +1,100 @@
|
||||
##
|
||||
# You should look at the following URL's in order to grasp a solid understanding
|
||||
# of Nginx configuration files in order to fully unleash the power of Nginx.
|
||||
# https://www.nginx.com/resources/wiki/start/
|
||||
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
|
||||
# https://wiki.debian.org/Nginx/DirectoryStructure
|
||||
#
|
||||
# In most cases, administrators will remove this file from sites-enabled/ and
|
||||
# leave it as reference inside of sites-available where it will continue to be
|
||||
# updated by the nginx packaging team.
|
||||
#
|
||||
# This file will automatically load configuration files provided by other
|
||||
# applications, such as Drupal or Wordpress. These applications will be made
|
||||
# available underneath a path with that package name, such as /drupal8.
|
||||
#
|
||||
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
|
||||
##
|
||||
|
||||
# Default server configuration
|
||||
#
|
||||
server {
|
||||
listen 8080 default_server;
|
||||
listen [::]:8080 default_server;
|
||||
|
||||
location / {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_pass http://localhost:5678;
|
||||
proxy_connect_timeout 900;
|
||||
proxy_send_timeout 900;
|
||||
proxy_read_timeout 900;
|
||||
}
|
||||
|
||||
# SSL configuration
|
||||
#
|
||||
# listen 443 ssl default_server;
|
||||
# listen [::]:443 ssl default_server;
|
||||
#
|
||||
# Note: You should disable gzip for SSL traffic.
|
||||
# See: https://bugs.debian.org/773332
|
||||
#
|
||||
# Read up on ssl_ciphers to ensure a secure configuration.
|
||||
# See: https://bugs.debian.org/765782
|
||||
#
|
||||
# Self signed certs generated by the ssl-cert package
|
||||
# Don't use them in a production server!
|
||||
#
|
||||
# include snippets/snakeoil.conf;
|
||||
|
||||
# root /var/www/html;
|
||||
|
||||
# Add index.php to the list if you are using PHP
|
||||
# index index.html index.htm index.nginx-debian.html;
|
||||
|
||||
# server_name _;
|
||||
|
||||
# location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
# try_files $uri $uri/ =404;
|
||||
# }
|
||||
|
||||
# pass PHP scripts to FastCGI server
|
||||
#
|
||||
#location ~ \.php$ {
|
||||
# include snippets/fastcgi-php.conf;
|
||||
#
|
||||
# # With php-fpm (or other unix sockets):
|
||||
# fastcgi_pass unix:/run/php/php7.3-fpm.sock;
|
||||
# # With php-cgi (or other tcp sockets):
|
||||
# fastcgi_pass 127.0.0.1:9000;
|
||||
#}
|
||||
|
||||
# deny access to .htaccess files, if Apache's document root
|
||||
# concurs with nginx's one
|
||||
#
|
||||
#location ~ /\.ht {
|
||||
# deny all;
|
||||
#}
|
||||
}
|
||||
|
||||
|
||||
# Virtual Host configuration for example.com
|
||||
#
|
||||
# You can move that to a different file under sites-available/ and symlink that
|
||||
# to sites-enabled/ to enable it.
|
||||
#
|
||||
#server {
|
||||
# listen 80;
|
||||
# listen [::]:80;
|
||||
#
|
||||
# server_name example.com;
|
||||
#
|
||||
# root /var/www/example.com;
|
||||
# index index.html;
|
||||
#
|
||||
# location / {
|
||||
# try_files $uri $uri/ =404;
|
||||
# }
|
||||
#}
|
@ -29,3 +29,33 @@
|
||||
shell: docker-compose up -d
|
||||
args:
|
||||
chdir: /root/nextcloud
|
||||
|
||||
- name: Installation de Nginx
|
||||
package:
|
||||
name: nginx
|
||||
state: present
|
||||
|
||||
- name: Copie de /etc/nginx/site-availables/proxy
|
||||
copy:
|
||||
src: /root/tools/ansible/gsb2021/roles/docker-nextcloud/files/proxy
|
||||
dest: /etc/nginx/sites-available
|
||||
|
||||
- name: Supression de /etc/nginx/sites-enabled/default
|
||||
file:
|
||||
path: /etc/nginx/sites-enabled/default
|
||||
state: absent
|
||||
|
||||
- name: Creation de lien symbolique avec /etc/nginx/sites-available/proxy dans /etc/nginx/sites-enabled/proxy
|
||||
shell: ln -s /etc/nginx/sites-availables/proxy proxy
|
||||
args:
|
||||
chdir: /etc/nginx/sites-enabled
|
||||
|
||||
- name: Redemmarage de Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
|
||||
- name: Copie de config.php dans /root/nextcloud/nextcloud/config
|
||||
copy:
|
||||
src: /root/tools/ansible/gsb2021/roles/docker-nextcloud/files/config.php
|
||||
dest: /root/nextcloud/nextcloud/config
|
||||
|
2
roles/fog/defaults/main.yml
Normal file
2
roles/fog/defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
depl_url: "http://s-adm.gsb.adm/gsbstore"
|
||||
depl_fog: "fogproject-1.5.9.tar.gz"
|
@ -6,10 +6,10 @@
|
||||
|
||||
- name: recuperation du fichier d'installation de fog
|
||||
get_url:
|
||||
url: http://depl/gsbstore/fogproject-1.5.7.tar.gz
|
||||
url: "{{ depl_url }}/{{ depl_fog }}"
|
||||
dest: /root/fog
|
||||
|
||||
- name: decompression du fichier d'installation de fog
|
||||
unarchive:
|
||||
src: /root/fog/fogproject-1.5.7.tar.gz
|
||||
src: "/root/fog/{{ depl_fog }}"
|
||||
dest: /root/fog
|
||||
|
@ -15,13 +15,13 @@ define hostgroup {
|
||||
define hostgroup {
|
||||
hostgroup_name debian-servers
|
||||
alias Serveurs distant
|
||||
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil
|
||||
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil, s-mess
|
||||
}
|
||||
|
||||
define hostgroup {
|
||||
hostgroup_name ssh-servers
|
||||
alias acces SSH
|
||||
members s-adm, s-infra, s-proxy, r-int, r-ext, localhost, gwsio2, s-itil
|
||||
members s-adm, s-infra, s-proxy, r-int, r-ext, localhost, gwsio2, s-itil, s-mess, s-lb
|
||||
}
|
||||
|
||||
define hostgroup {
|
||||
@ -39,7 +39,7 @@ define hostgroup {
|
||||
define hostgroup {
|
||||
hostgroup_name http-servers
|
||||
alias serveurs-web
|
||||
members localhost, s-itil
|
||||
members localhost, s-itil, s-adm
|
||||
}
|
||||
|
||||
#define hostgroup {
|
||||
@ -69,6 +69,7 @@ define hostgroup{
|
||||
define hostgroup{
|
||||
hostgroup_name uptimegrp
|
||||
alias uptimegrp
|
||||
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil
|
||||
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil, s-mess, s-lb
|
||||
}
|
||||
|
||||
|
||||
|
14
roles/icinga/files/cfg/s-lb.cfg
Normal file
14
roles/icinga/files/cfg/s-lb.cfg
Normal file
@ -0,0 +1,14 @@
|
||||
# A simple configuration file for monitoring the local host
|
||||
# This can serve as an example for configuring other servers;
|
||||
# Custom services specific to this host are added here, but services
|
||||
# defined in nagios2-common_services.cfg may also apply.
|
||||
#
|
||||
|
||||
define host{
|
||||
use generic-host ; Name of host template$
|
||||
host_name s-lb
|
||||
alias debian-servers
|
||||
address 192.168.100.10
|
||||
parents r-int
|
||||
}
|
||||
|
14
roles/icinga/files/cfg/s-mess.cfg
Normal file
14
roles/icinga/files/cfg/s-mess.cfg
Normal file
@ -0,0 +1,14 @@
|
||||
# A simple configuration file for monitoring the local host
|
||||
# This can serve as an example for configuring other servers;
|
||||
# Custom services specific to this host are added here, but services
|
||||
# defined in nagios2-common_services.cfg may also apply.
|
||||
#
|
||||
|
||||
define host{
|
||||
use generic-host ; Name of host template$
|
||||
host_name s-mess
|
||||
alias nextcloud
|
||||
address 172.16.0.7
|
||||
parents r-int
|
||||
}
|
||||
|
@ -21,9 +21,9 @@ allow-hotplug enp0s9
|
||||
iface enp0s9 inet static
|
||||
address 192.168.1.2
|
||||
netmask 255.255.255.0
|
||||
post-up ip route add 172.16.128.0/24 via 192.168.1.2
|
||||
post-up ip route add 172.16.0.0/24 via 192.168.1.1
|
||||
post-up ip route add 192.168.200.0/24 via 192.168.1.1
|
||||
post-up /usr/sbin/ip route add 172.16.128.0/24 via 192.168.1.2
|
||||
post-up /usr/sbin/ip route add 172.16.0.0/24 via 192.168.1.1
|
||||
post-up /usr/sbin/ip route add 192.168.200.0/24 via 192.168.1.1
|
||||
|
||||
# up route add -net 172.16.128.0/24 gw 192.168.0.52
|
||||
# up route add default gw 192.168.1.1
|
||||
|
@ -21,8 +21,8 @@ allow-hotplug enp0s9
|
||||
iface enp0s9 inet static
|
||||
address 192.168.0.52
|
||||
netmask 255.255.255.0
|
||||
post-up ip route add 192.168.1.0/24 via 172.16.128.254/24
|
||||
post-up ip route add 172.16.0.0/24 via 172.16.128.254/24
|
||||
post-up /usr/sbin/ip route add 192.168.1.0/24 via 172.16.128.254/24
|
||||
post-up /usr/sbin/ip route add 172.16.0.0/24 via 172.16.128.254/24
|
||||
|
||||
# up route add -net 192.168.1.0/24 gw 192.168.0.52
|
||||
# post-up /bin/bash /root/iptables-vpn
|
||||
|
@ -9,3 +9,6 @@ iface lo inet loopback
|
||||
allow-hotplug enp0s3
|
||||
iface enp0s3 inet dhcp
|
||||
|
||||
allow-hotplug enp0s8
|
||||
iface enp0s8 inet dhcp
|
||||
|
||||
|
@ -44,7 +44,7 @@ backend fermeweb
|
||||
#option httpchk HEAD / HTTP/1.0
|
||||
server s-lb-web1 192.168.101.1:80 check
|
||||
server s-lb-web2 192.168.101.2:80 check
|
||||
|
||||
# server s-lb-web3 192.168.101.3:80 check
|
||||
|
||||
listen stats
|
||||
bind *:8080
|
||||
|
@ -4,7 +4,7 @@ apt-get update && apt-get upgrade -y
|
||||
# Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
|
||||
echo "mysql-server mysql-server/root_password password root" | debconf-set-selections
|
||||
echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections
|
||||
apt-get -y install mariadb-server
|
||||
apt-get -y install mysql-server
|
||||
|
||||
|
||||
# Run the MySQL Secure Installation wizard
|
||||
|
@ -25,6 +25,14 @@
|
||||
- {'regexp': "define\\('DB_USER', '(.)+'\\);", 'line': "define('DB_USER', '{{wp_mysql_user}}');"}
|
||||
- {'regexp': "define\\('DB_PASSWORD', '(.)+'\\);", 'line': "define('DB_PASSWORD', '{{wp_mysql_password}}');"}
|
||||
|
||||
|
||||
- name: Attributions des permissions
|
||||
file:
|
||||
path: /home/wordpress
|
||||
recurse: yes
|
||||
owner: 33
|
||||
group: 33
|
||||
|
||||
# - name: Fix permissions
|
||||
# shell: chown -R www-data /var/www/wordpress/*
|
||||
#
|
||||
|
7
roles/ssh-root-access/tasks/main.yml
Normal file
7
roles/ssh-root-access/tasks/main.yml
Normal file
@ -0,0 +1,7 @@
|
||||
- name: Activation acces ssh root pour vp-1 (certificat)
|
||||
lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
regexp: "^PermitRootLogin"
|
||||
line: "PermitRootLogin yes"
|
||||
state: present
|
||||
|
@ -7,7 +7,7 @@ conn tunnel #
|
||||
left=192.168.0.52
|
||||
leftsubnet=172.16.128.0/24
|
||||
right=192.168.0.51
|
||||
rightsubnet=192.168.0.0/16, 172.16.0.0/24
|
||||
rightsubnet=192.168.1.0/24, 192.168.200.0/24, 172.16.0.0/24
|
||||
ike=aes256-sha2_256-modp1024!
|
||||
esp=aes256-sha2_256!
|
||||
keyingtries=0
|
||||
@ -22,4 +22,4 @@ conn tunnel #
|
||||
type=tunnel
|
||||
leftcert=r-vp2Cert.pem
|
||||
leftid="C=CH, O=GSB, CN=r-vp2"
|
||||
rightid="C=CH, O=GSB, CN=r-vp1"
|
||||
rightid="C=CH, O=GSB, CN=r-vp1"
|
||||
|
@ -5,7 +5,7 @@ config setup
|
||||
conn %default
|
||||
conn tunnel #
|
||||
left=192.168.0.51
|
||||
leftsubnet=192.168.0.0/16, 172.16.0.0/24
|
||||
leftsubnet=192.168.1.0/24, 192.168.200.0/24, 172.16.0.0/24
|
||||
right=192.168.0.52
|
||||
rightsubnet=172.16.128.0/24
|
||||
ike=aes256-sha2_256-modp1024!
|
||||
@ -22,4 +22,4 @@ conn tunnel #
|
||||
type=tunnel
|
||||
leftcert=r-vp1Cert.pem
|
||||
leftid="C=CH, O=GSB, CN=r-vp1"
|
||||
rightid="C=CH, O=GSB, CN=r-vp2"
|
||||
rightid="C=CH, O=GSB, CN=r-vp2"
|
||||
|
@ -7,3 +7,4 @@
|
||||
- ssh-cli
|
||||
- syslog-cli
|
||||
- post
|
||||
- goss
|
||||
|
Reference in New Issue
Block a user