Compare commits

..

6 Commits

Author SHA1 Message Date
0dbbaf0751 modif README.md 2023-01-30 11:08:22 +01:00
64f1b74ba7 Merge branch 'main' of https://gitea.lyc-lecastel.fr/gadmin/gsb2023 2023-01-30 10:57:28 +01:00
5ddbedac97 ajout et changementroles fw-vpn 2023-01-30 10:57:23 +01:00
05ddace1af lb-bd rev2 2023-01-30 10:44:18 +01:00
9019c0dbe7 modification de lb-bd 2023-01-30 10:36:52 +01:00
9fd18796a6 modif README.md 2023-01-27 09:49:23 +01:00
10 changed files with 94 additions and 58 deletions

View File

@ -15,6 +15,7 @@
# - firewall-vpn-r # - firewall-vpn-r
- wireguard-r - wireguard-r
# - x509-r # - x509-r
- fw-ferm
- ssh-cli - ssh-cli
- syslog-cli - syslog-cli
- post - post

View File

@ -18,6 +18,7 @@
# - firewall-vpn-l # - firewall-vpn-l
- wireguard-l - wireguard-l
# - x509-l # - x509-l
- fw-ferm
- ssh-cli - ssh-cli
- syslog-cli - syslog-cli
- post - post

View File

@ -1,16 +0,0 @@
[Ferm]:http://ferm.foo-projects.org/
Modifier l'execution d'iptables [plus d'info ici]:https://wiki.debian.org/iptables
```bash
update-alternatives --set iptables /usr/sbin/iptables-legacy```
Pour tester utiliser [Nmap]:https://nmap.org/man/fr/man-briefoptions.html
```bash
sudo nmap -p51820 192.168.0.51```(r-vp1)
```bash
sudo nmap -p51820 192.168.0.52```(r-vp2)
Sortie :
`PORT STATE SERVICE
51820/tcp filtered unknown`
Faire des ping!

View File

@ -1,16 +1,23 @@
[Ferm]:http://ferm.foo-projects.org/ [Ferm]:http://ferm.foo-projects.org/
Modifier l'execution d'iptables [plus d'info ici]:https://wiki.debian.org/iptables Modifier l'execution d'iptables [plus d'info ici]:https://wiki.debian.org/iptables
```bash ```shell
update-alternatives --set iptables /usr/sbin/iptables-legacy``` update-alternatives --set iptables /usr/sbin/iptables-legacy
```
Pour tester utiliser [Nmap]:https://nmap.org/man/fr/man-briefoptions.html Pour tester utiliser [Nmap]:https://nmap.org/man/fr/man-briefoptions.html
```bash ### r-vp1
sudo nmap -p51820 192.168.0.51```(r-vp1) ```shell
```bash sudo nmap -p51820 192.168.0.51
sudo nmap -p51820 192.168.0.52```(r-vp2) ```
### r-vp2
Sortie : ```shell
sudo nmap -p51820 192.168.0.52
```
### Sortie :
```
`PORT STATE SERVICE `PORT STATE SERVICE
51820/tcp filtered unknown` 51820/tcp filtered unknown`
```
Faire des ping! Faire des ping!

View File

@ -0,0 +1,15 @@
---
- name: installation de ferm
apt:
name: ferm
state: present
- name: copie du ferm.conf
copy:
src: ferm.conf.{{ ansible_hostname }}
dest: /etc/ferm/ferm.conf
- name: redemarage service ferm
ansible.builtin.service:
name: ferm.service
state: restarted

View File

@ -4,16 +4,16 @@
name: wireguard name: wireguard
state: present state: present
- name: installation de ferm
apt:
name: ferm
state: present
- name: installation de wireguard-tools - name: installation de wireguard-tools
apt: apt:
name: wireguard-tools name: wireguard-tools
state: present state: present
#- name: installation de sshpass
# apt:
# name: sshpass
# state: present
#- name: copie du fichier de configuration depuis r-vp1 #- name: copie du fichier de configuration depuis r-vp1
# command: "sshpass -p 'root' scp -r root@192.168.99.112:/root/confwg/wg0-b.conf /etc/wireguard/" # command: "sshpass -p 'root' scp -r root@192.168.99.112:/root/confwg/wg0-b.conf /etc/wireguard/"

View File

@ -4,6 +4,11 @@
name: wireguard name: wireguard
state: present state: present
- name: installation de ferm
apt:
name: ferm
state: present
- name: installation de wireguard-tools - name: installation de wireguard-tools
apt: apt:
name: wireguard-tools name: wireguard-tools
@ -27,12 +32,10 @@
- name: copie du fichier de configuration - name: copie du fichier de configuration
copy: copy:
src: /root/confwg/wg0-a.conf src: /root/confwg/wg0-a.conf
dest: /etc/wireguard dest: /etc/wireguard/wg0.conf
- name: renommage fichier de configuration - name: Restart service httpd, in all cases
command: "mv /etc/wireguard/wg0-a.conf /etc/wireguard/wg0.conf" ansible.builtin.service:
name: wg-quick@wg0
- name: demarrage du service wireguard enabled: yes
tags: aaaa state: restarted
command: "systemctl enable wg-quick@wg0"
command: "systemctl restart wg-quick@wg0"

View File

@ -1,24 +1,49 @@
--- ---
- hosts: localhost - hosts: all
connection: local become: true
vars: tasks:
maria_dbhost: "192.168.102.254"
maria_dbname: "wordpress"
maria_dbuser: "wp"
maria_dbpasswd: "wp"
- name: modules python pour
apt:
name: python3-pymysql
state: present
- name: install mariadb-server
apt:
name: mariadb-server
state: present
- name: Cree Bd wordpress
mysql_db:
db: wordpressdb
login_unix_socket: /var/run/mysqld/mysqld.sock
state: present
- name: Ouvre port 3306 mariadb-server
replace:
path: /etc/mysql/mariadb.conf.d/50-server.cnf
regexp: '^bind-address.*'
replace: '#bind-adress = 127.0.0.1'
backup: yes
notify: restart mariadb
- name: Create MySQL user for wordpress
mysql_user:
name: wordpressuser
password: wordpresspasswd
priv: "wordpressdb.*:ALL"
host: '%'
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
handlers:
- name: restart mariadb
ansible.builtin.service:
name: mariadb
state: restarted
roles: roles:
- base - base
- goss - goss
- post - post
#- s-lb-bd-ab
- mariadb-ab
# - role: db-user
# cli_ip: "192.168.102.1"
# - role: db-user
# cli_ip: "192.168.102.2"
# - role: db-user
# cli_ip: "192.168.102.3"
- snmp-agent - snmp-agent
# - post