Compare commits

...

14 Commits

13 changed files with 67 additions and 18 deletions

View File

@ -27,7 +27,7 @@ services:
volumes:
- nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=nextcloud
- MYSQL_PASSWORD=root
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db

View File

@ -2,15 +2,42 @@
- name: Installation des paquets python-mysqldb mariadb-server
apt:
name:
- python-mysqldb
- mariadb-server
- python3-mysqldb
- mariadb-server
- python3-passlib
- python3-pymysql
state: present
- name: python3 par defaut
alternatives:
link: /usr/bin/python
name: python
path: /usr/bin/python3
priority: 10
- name: Create mysql database
mysql_db: name={{ maria_dbname }} state=present
mysql_db:
name: "{{ maria_dbname }}"
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Creation de l'utilisateur mysql avec tous les privileges
mysql_user:
name: "{{ maria_dbuser }}"
password: "{{ maria_dbpasswd }}"
priv: '*.*:ALL,GRANT'
login_unix_socket: /var/run/mysqld/mysqld.sock
with_items:
- "127.0.0.1"
# - ::1
# - localhost
- name: Copie du fichier my.cnf pour autorises toutes les adresses sur le port 3306
copy : src=my.cnf dest=/etc/mysql/
copy:
src: my.cnf
dest: /etc/mysql/
- name: Redemarrage du service mariadb
shell: service mariadb restart
service:
name: mariadb
state: restarted

View File

@ -1,6 +1,5 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
#auto lo
#iface lo inet loopback
@ -22,8 +21,11 @@ allow-hotplug enp0s9
iface enp0s9 inet static
address 192.168.1.2
netmask 255.255.255.0
up route add -net 172.16.128.0/24 gw 192.168.1.2
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
# post-up /bin/bash /root/iptables-vpn
post-up /etc/init.d/ipsec restart
post-up /etc/init.d/ipsec restart

View File

@ -1,6 +1,5 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
#auto lo
#iface lo inet loopback
@ -22,7 +21,9 @@ allow-hotplug enp0s9
iface enp0s9 inet static
address 192.168.0.52
netmask 255.255.255.0
# up route add -net 192.168.1.0/24 gw 172.16.128.254
up route add -net 192.168.1.0/24 gw 192.168.0.52
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
post-up /etc/init.d/ipsec restart
post-up /etc/init.d/ipsec restart

View File

@ -9,3 +9,6 @@ iface lo inet loopback
allow-hotplug enp0s3
iface enp0s3 inet dhcp
allow-hotplug enp0s8
iface enp0s8 inet dhcp

View File

@ -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.2:80 check
listen stats
bind *:8080

View File

@ -13,4 +13,4 @@ mysql_secure_installation
sed -i 's/127\.0\.0\.1/0\.0\.0\.0/g' /etc/mysql/my.cnf
mysql -uroot -p -e 'USE mysql; UPDATE `user` SET `Host`="%" WHERE `User`="root" AND `Host`="localhost"; DELETE FROM `user` WHERE `Host` != "%" AND `User`="root"; FLUSH PRIVILEGES;'
service mysql restart
service mysql restart

View File

@ -0,0 +1,2 @@
depl_url: "http://s-adm.gsb.adm/gsbstore/"
depl_wordpress: "wordpress-5.6-fr_FR.tar.gz"

View File

@ -5,9 +5,11 @@
state: directory
- name: download and extract wordpress
unarchive:
src: http://depl/gsbstore/wordpress-5.6-fr_FR.tar.gz
src: "{{ depl_url }}/{{ depl_wordpress }}"
dest: /home/
remote_src: yes
owner: www-data
group: www-data
- name: Copy sample config file
command: mv /home/wordpress/wp-config-sample.php /home/wordpress/wp-config.php creates=/home/wordpress/wp-config.php
@ -23,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/*
#

View File

@ -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
@ -20,3 +20,4 @@ conn tunnel #
auto=start
keyexchange=ikev2
type=tunnel
#

View File

@ -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!
@ -20,3 +20,4 @@ conn tunnel #
auto=start
keyexchange=ikev2
type=tunnel
#

1
s-lb-bd.retry Normal file
View File

@ -0,0 +1 @@
localhost

1
s-nas.retry Normal file
View File

@ -0,0 +1 @@
localhost