Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f43128e7b9 | ||
0889769008 | |||
eeff416aea | |||
713f0d2996 | |||
|
ca000e0b57 | ||
|
e428c52cbe | ||
|
689aa9faa2 | ||
|
254b9810be | ||
|
47b4a07b23 | ||
|
79bf771c49 |
8
AP4/onfarbo41/ansible/adminer.yml
Normal file
8
AP4/onfarbo41/ansible/adminer.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
- name: Playbook pour adminer
|
||||||
|
hosts: onfarbo
|
||||||
|
become: yes
|
||||||
|
become_method: sudo
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- adminer
|
8
AP4/onfarbo41/ansible/db.yml
Normal file
8
AP4/onfarbo41/ansible/db.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
- name: Playbook pour la BDD
|
||||||
|
hosts: onfarbo
|
||||||
|
become: yes
|
||||||
|
become_method: sudo
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- db
|
8
AP4/onfarbo41/ansible/dokuwiki.yml
Normal file
8
AP4/onfarbo41/ansible/dokuwiki.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
- name: Playbook pour le dokuwiki
|
||||||
|
hosts: onfarbo
|
||||||
|
become: yes
|
||||||
|
become_method: sudo
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- dokuwiki
|
2
AP4/onfarbo41/ansible/hosts
Normal file
2
AP4/onfarbo41/ansible/hosts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[onfarbo]
|
||||||
|
onfarbo41
|
10
AP4/onfarbo41/ansible/playbook.yml
Normal file
10
AP4/onfarbo41/ansible/playbook.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
- name: Playbook pour onfarbo41
|
||||||
|
hosts: onfarbo
|
||||||
|
become: yes
|
||||||
|
become_method: sudo
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- adminer
|
||||||
|
- db
|
||||||
|
- dokuwiki
|
38
AP4/onfarbo41/ansible/roles/adminer/README.md
Normal file
38
AP4/onfarbo41/ansible/roles/adminer/README.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
Role Name
|
||||||
|
=========
|
||||||
|
|
||||||
|
A brief description of the role goes here.
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||||
|
|
||||||
|
Role Variables
|
||||||
|
--------------
|
||||||
|
|
||||||
|
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||||
|
|
||||||
|
Example Playbook
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||||
|
|
||||||
|
- hosts: servers
|
||||||
|
roles:
|
||||||
|
- { role: username.rolename, x: 42 }
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
BSD
|
||||||
|
|
||||||
|
Author Information
|
||||||
|
------------------
|
||||||
|
|
||||||
|
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
4
AP4/onfarbo41/ansible/roles/adminer/handlers/main.yml
Normal file
4
AP4/onfarbo41/ansible/roles/adminer/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- name: restart apache
|
||||||
|
service:
|
||||||
|
name: apache2
|
||||||
|
state: restarted
|
34
AP4/onfarbo41/ansible/roles/adminer/tasks/main.yml
Normal file
34
AP4/onfarbo41/ansible/roles/adminer/tasks/main.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
- name: apt update
|
||||||
|
tags: update
|
||||||
|
apt:
|
||||||
|
update-cache: yes
|
||||||
|
cache_valid_time: 3600
|
||||||
|
|
||||||
|
- name: install utils
|
||||||
|
tags: utils
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- apache2
|
||||||
|
- php
|
||||||
|
- php-common
|
||||||
|
- libapache2-mod-php
|
||||||
|
- php-cli
|
||||||
|
- php-xml
|
||||||
|
- php-mysql
|
||||||
|
- php-curl
|
||||||
|
- mariadb-server
|
||||||
|
- adminer
|
||||||
|
- python3-pymysql
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: On créer un lien symbolique
|
||||||
|
tags: link
|
||||||
|
file:
|
||||||
|
src: /usr/share/adminer/adminer
|
||||||
|
dest: /var/www/html/adminer
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: Message d'information
|
||||||
|
tags: msg
|
||||||
|
debug: msg="Adminer sera accessible depuis l'adresse http://onfarbo41/adminer.php"
|
||||||
|
|
1
AP4/onfarbo41/ansible/roles/adminer/vars/main.yml
Normal file
1
AP4/onfarbo41/ansible/roles/adminer/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
alias: "Alias /adminer.php /usr/share/adminer/adminer.php"
|
4
AP4/onfarbo41/ansible/roles/db/handlers/main.yml
Normal file
4
AP4/onfarbo41/ansible/roles/db/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- name: restart apache
|
||||||
|
service:
|
||||||
|
name: apache2
|
||||||
|
state: restarted
|
20
AP4/onfarbo41/ansible/roles/db/tasks/main.yml
Normal file
20
AP4/onfarbo41/ansible/roles/db/tasks/main.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
- name: On démarre MariaDB
|
||||||
|
tags: mariadb
|
||||||
|
service:
|
||||||
|
name: mysql
|
||||||
|
state: started
|
||||||
|
|
||||||
|
- name: Création de la BDD bdarbre
|
||||||
|
tags: bdarbre
|
||||||
|
mysql_db:
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
name: bdarbre
|
||||||
|
|
||||||
|
- name: Création de l'utilisateur slam
|
||||||
|
tags: user
|
||||||
|
mysql_user:
|
||||||
|
name: slam
|
||||||
|
password: Azerty1+
|
||||||
|
priv: '*.*:ALL,GRANT'
|
||||||
|
state: present
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
20
AP4/onfarbo41/ansible/roles/dokuwiki/files/dokuwiki.sh
Executable file
20
AP4/onfarbo41/ansible/roles/dokuwiki/files/dokuwiki.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
chemin=/var/www/html/doku
|
||||||
|
|
||||||
|
apt install -y apache2 php php-mbstring php-gd php-xml
|
||||||
|
cd /root
|
||||||
|
[ -r dokuwiki-stable.tgz ] || wget http://depl/store/dokuwiki-stable.tgz
|
||||||
|
|
||||||
|
if [ $? !=0 ]; then
|
||||||
|
echo "$0 : erreurwget" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
tar xvfz dokuwiki-stable.tgz
|
||||||
|
[ -d "${chemin}" ] || mkdir "${chemin}"
|
||||||
|
|
||||||
|
cp -a dokuwiki-2020-07-29/* "${chemin}"
|
||||||
|
cd "${chemin}"
|
||||||
|
chown -R root:root .
|
||||||
|
chmod -R 755 .
|
||||||
|
chown -R www-data:www-data data lib conf
|
||||||
|
exit 0
|
4
AP4/onfarbo41/ansible/roles/dokuwiki/handlers/main.yml
Normal file
4
AP4/onfarbo41/ansible/roles/dokuwiki/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- name: restart apache
|
||||||
|
service:
|
||||||
|
name: apache2
|
||||||
|
state: restarted
|
26
AP4/onfarbo41/ansible/roles/dokuwiki/tasks/main.yml
Normal file
26
AP4/onfarbo41/ansible/roles/dokuwiki/tasks/main.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
- name: Création du dossier DokuWiki
|
||||||
|
tags: createfile
|
||||||
|
file:
|
||||||
|
path: /root/dokuwiki
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: copie du fichier script d'install de dokuwiki
|
||||||
|
tags: sh
|
||||||
|
copy:
|
||||||
|
src: dokuwiki.sh
|
||||||
|
dest: /root/dokuwiki
|
||||||
|
|
||||||
|
- name: On rend exécutable le script d'install
|
||||||
|
tags: chmod
|
||||||
|
file:
|
||||||
|
path: /root/dokuwiki/dokuwiki.sh
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: exécution du script d'install de dokuwiki
|
||||||
|
tags: exec
|
||||||
|
command: bash /root/dokuwiki/dokuwiki.sh
|
||||||
|
|
||||||
|
- name: Message d'information pour dokuwiki
|
||||||
|
tags: msg2
|
||||||
|
debug: msg="Le dokuwiki devra être installer depuis l'adresse http://onfarbo41/doku/install.php"
|
36
AP4/onfarbo41/gosstest/goss.yaml
Normal file
36
AP4/onfarbo41/gosstest/goss.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#Ici, on test MariaDB
|
||||||
|
port:
|
||||||
|
tcp:3306:
|
||||||
|
listening: true
|
||||||
|
ip:
|
||||||
|
- 127.0.0.1
|
||||||
|
|
||||||
|
#Ici, on test ssh
|
||||||
|
service:
|
||||||
|
ssh:
|
||||||
|
enabled: true
|
||||||
|
running: true
|
||||||
|
group:
|
||||||
|
ssh:
|
||||||
|
exists: true
|
||||||
|
gid: 111
|
||||||
|
|
||||||
|
#Ici, on test le serveur web
|
||||||
|
http:
|
||||||
|
http://10.121.38.206:
|
||||||
|
status: 200
|
||||||
|
allow-insecure: false
|
||||||
|
no-follow-redirects: false
|
||||||
|
timeout: 5000
|
||||||
|
body:
|
||||||
|
- works
|
||||||
|
|
||||||
|
#Ici, on test dokuwiki
|
||||||
|
http:
|
||||||
|
http://10.121.38.206/doku/:
|
||||||
|
status: 200
|
||||||
|
allow-insecure: false
|
||||||
|
no-follow-redirects: false
|
||||||
|
timeout: 5000
|
||||||
|
body:
|
||||||
|
- Trace
|
5
AP4/onfarbo41/onfinfra/ansible/glpi.yml
Normal file
5
AP4/onfarbo41/onfinfra/ansible/glpi.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
connection: local
|
||||||
|
roles:
|
||||||
|
- glpi
|
10
AP4/onfarbo41/onfinfra/ansible/roles/glpi/defaults/main.yml
Normal file
10
AP4/onfarbo41/onfinfra/ansible/roles/glpi/defaults/main.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
depl_url: "http://depl/store"
|
||||||
|
glpi_tgz: "glpi-9.5.7.tgz"
|
||||||
|
fusion: "fusioninventory-9.5+3.0.tar.bz2"
|
||||||
|
fusion64: "fusioninventory-agent_windows-x64_2.6.exe"
|
||||||
|
glpi_dir: "/var/www/html/glpi"
|
||||||
|
glpi_dbhost: "127.0.0.1"
|
||||||
|
glpi_dbname: "glpi"
|
||||||
|
glpi_dbuser: "glpi"
|
||||||
|
glpi_dbpasswd: "glpi"
|
||||||
|
|
12
AP4/onfarbo41/onfinfra/ansible/roles/glpi/files/glpi.conf
Normal file
12
AP4/onfarbo41/onfinfra/ansible/roles/glpi/files/glpi.conf
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
DocumentRoot /var/www/glpi
|
||||||
|
<Directory /var/www/glpi>
|
||||||
|
Options Indexes FollowSymLinks MultiViews
|
||||||
|
AllowOverride All
|
||||||
|
Order allow,deny
|
||||||
|
allow from all
|
||||||
|
AuthType Basic
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/glpi_access.log combined
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/glpi_error.log
|
3
AP4/onfarbo41/onfinfra/ansible/roles/glpi/files/my.cnf
Normal file
3
AP4/onfarbo41/onfinfra/ansible/roles/glpi/files/my.cnf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[client]
|
||||||
|
user=root
|
||||||
|
password=root
|
18
AP4/onfarbo41/onfinfra/ansible/roles/glpi/handlers/main.yml
Normal file
18
AP4/onfarbo41/onfinfra/ansible/roles/glpi/handlers/main.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
- name: restart php-fpm
|
||||||
|
service:
|
||||||
|
name: php-fpm
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
|
- name: restart nginx
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state : restarted
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
|
- name: restart mariadb-server
|
||||||
|
service:
|
||||||
|
name: mariadb-server
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
134
AP4/onfarbo41/onfinfra/ansible/roles/glpi/tasks/main.yml
Normal file
134
AP4/onfarbo41/onfinfra/ansible/roles/glpi/tasks/main.yml
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
---
|
||||||
|
- name: Installation des paquets
|
||||||
|
apt:
|
||||||
|
state: latest
|
||||||
|
name:
|
||||||
|
- nginx
|
||||||
|
- php-fpm
|
||||||
|
- php-mbstring
|
||||||
|
- php-mysql
|
||||||
|
- php-gd
|
||||||
|
- php-curl
|
||||||
|
- php-xml
|
||||||
|
- php-apcu
|
||||||
|
- php-ldap
|
||||||
|
- php-imap
|
||||||
|
- php-xmlrpc
|
||||||
|
- php-cas
|
||||||
|
- python3-mysqldb
|
||||||
|
- mariadb-server
|
||||||
|
- python3-pymysql
|
||||||
|
- php-intl
|
||||||
|
- php-bz2
|
||||||
|
- php-zip
|
||||||
|
- postfix
|
||||||
|
- mailutils
|
||||||
|
|
||||||
|
- name: Changement listen dans le fichier conf de php
|
||||||
|
replace:
|
||||||
|
dest: /etc/php/7.4/fpm/pool.d/www.conf
|
||||||
|
regexp: 'listen = /run/php/php7.4-fpm.sock'
|
||||||
|
replace: 'listen = 127.0.0.1:9000'
|
||||||
|
backup: yes
|
||||||
|
|
||||||
|
- name: Effacement block nginx default
|
||||||
|
file:
|
||||||
|
path: /etc/nginx/sites-enabled/default
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Creation fichier block nginx
|
||||||
|
template:
|
||||||
|
src: block.j2
|
||||||
|
dest: /etc/nginx/sites-enabled/glpi
|
||||||
|
|
||||||
|
- name: Remplacement dans le fichier de conf php du timeout
|
||||||
|
replace:
|
||||||
|
dest: /etc/php/7.4/fpm/php.ini
|
||||||
|
regexp: 'max_execution_time = 30'
|
||||||
|
replace: 'max_execution_time = 600'
|
||||||
|
backup: yes
|
||||||
|
|
||||||
|
notify:
|
||||||
|
- restart nginx
|
||||||
|
|
||||||
|
- name: Creation de la base de donnee mysql
|
||||||
|
mysql_db:
|
||||||
|
name: "{{ glpi_dbname }}"
|
||||||
|
check_implicit_admin: yes
|
||||||
|
state: present
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
|
||||||
|
- name: Creation de l'utilisateur mysql avec tous les privileges
|
||||||
|
mysql_user:
|
||||||
|
user: "{{ glpi_dbuser }}"
|
||||||
|
password: "{{ glpi_dbpasswd }}"
|
||||||
|
priv: "*.*:ALL,GRANT"
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
state: present
|
||||||
|
# with_items:
|
||||||
|
# - 127.0.0.1
|
||||||
|
|
||||||
|
- name: Creation du repertoire {{ glpi_dir }}
|
||||||
|
file:
|
||||||
|
path: "{{ glpi_dir }}"
|
||||||
|
state: directory
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
|
||||||
|
- name: Installation de GLPI
|
||||||
|
unarchive:
|
||||||
|
src: "{{ depl_url }}/{{ glpi_tgz }}"
|
||||||
|
dest: /var/www/html
|
||||||
|
remote_src: yes
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
|
||||||
|
- name: Changement des attributs {{ glpi_dir }}
|
||||||
|
file:
|
||||||
|
path: "{{ glpi_dir }}"
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
mode: 0755
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Changement des attributs {{ glpi_dir }}/plugins
|
||||||
|
file:
|
||||||
|
path: "{{ glpi_dir }}/plugins"
|
||||||
|
mode: 0777
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Installation de Fusioninventory pour Linux
|
||||||
|
unarchive:
|
||||||
|
src: "{{ depl_url }}/{{ fusion }}"
|
||||||
|
dest: "/var/www/html/glpi/plugins"
|
||||||
|
remote_src: yes
|
||||||
|
|
||||||
|
- name: Creation de ficlient
|
||||||
|
file:
|
||||||
|
path: /var/www/html/ficlients
|
||||||
|
state: directory
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
mode: 0775
|
||||||
|
|
||||||
|
- name: Attribution des droits nginx.index
|
||||||
|
file:
|
||||||
|
path: /var/www/html/index.nginx-debian.html
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
mode: 0775
|
||||||
|
|
||||||
|
- name: Installation de FusionInventory windows x64
|
||||||
|
get_url:
|
||||||
|
url: "{{ depl_url }}/{{ fusion64 }}"
|
||||||
|
dest: "/var/www/html/ficlients"
|
||||||
|
|
||||||
|
- name: Attribution des permissions sur repertoire /plugins/fusioninventory
|
||||||
|
file:
|
||||||
|
path: /var/www/html/glpi/plugins/fusioninventory
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
recurse: yes
|
||||||
|
state: directory
|
23
AP4/onfarbo41/onfinfra/ansible/roles/glpi/templates/block.j2
Normal file
23
AP4/onfarbo41/onfinfra/ansible/roles/glpi/templates/block.j2
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
root {{ glpi_dir }};
|
||||||
|
index index.php;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {try_files $uri $uri/ index.php;}
|
||||||
|
|
||||||
|
#prise en charge PHP
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass 127.0.0.1:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include /etc/nginx/fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SERVER_NAME $host;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /ficlients {
|
||||||
|
root /var/www/html;
|
||||||
|
autoindex on;
|
||||||
|
}
|
||||||
|
}
|
39
AP4/onfarbo41/onfinfra/goss/goss.yaml
Normal file
39
AP4/onfarbo41/onfinfra/goss/goss.yaml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
port:
|
||||||
|
tcp:80:
|
||||||
|
listening: true
|
||||||
|
ip:
|
||||||
|
- 0.0.0.0
|
||||||
|
tcp:3306:
|
||||||
|
listening: true
|
||||||
|
ip:
|
||||||
|
- 127.0.0.1
|
||||||
|
service:
|
||||||
|
mysql:
|
||||||
|
enabled: true
|
||||||
|
running: true
|
||||||
|
user:
|
||||||
|
mysql:
|
||||||
|
exists: true
|
||||||
|
uid: 106
|
||||||
|
gid: 112
|
||||||
|
groups:
|
||||||
|
- mysql
|
||||||
|
home: /nonexistent
|
||||||
|
shell: /bin/false
|
||||||
|
group:
|
||||||
|
mysql:
|
||||||
|
exists: true
|
||||||
|
gid: 112
|
||||||
|
interface:
|
||||||
|
enp0s3:
|
||||||
|
exists: true
|
||||||
|
addrs:
|
||||||
|
- 192.168.2.12/24
|
||||||
|
- fe80::a00:27ff:fea2:45fd/64
|
||||||
|
mtu: 1500
|
||||||
|
enp0s8:
|
||||||
|
exists: true
|
||||||
|
addrs:
|
||||||
|
- 192.168.0.39/24
|
||||||
|
- fe80::a00:27ff:fe66:36e3/64
|
||||||
|
mtu: 1500
|
1
AP4/onfarbo41/wireguard/wireguard-confcli/endpoint-b.key
Normal file
1
AP4/onfarbo41/wireguard/wireguard-confcli/endpoint-b.key
Normal file
@@ -0,0 +1 @@
|
|||||||
|
KClI53wv5L7AZ9ZOQPNzPqIuQVyfda0VpzLsykuXdXg=
|
1
AP4/onfarbo41/wireguard/wireguard-confcli/endpoint-b.pub
Normal file
1
AP4/onfarbo41/wireguard/wireguard-confcli/endpoint-b.pub
Normal file
@@ -0,0 +1 @@
|
|||||||
|
GoHn0zP27+IFPcApQl/Je7EZg2gCrpvr1+Vt6H35AA0=
|
11
AP4/onfarbo41/wireguard/wireguard-confcli/wg0.conf
Normal file
11
AP4/onfarbo41/wireguard/wireguard-confcli/wg0.conf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# local settings for Endpoint B
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = KClI53wv5L7AZ9ZOQPNzPqIuQVyfda0VpzLsykuXdXg= #Clé privée du client
|
||||||
|
Address = 10.0.0.2/32 #Adresse du client
|
||||||
|
ListenPort = 51820
|
||||||
|
|
||||||
|
# remote settings for Endpoint A
|
||||||
|
[Peer]
|
||||||
|
PublicKey = qxFRWqsOToqCiV3xlCNFh33mDCm0Mb1U/yDukcfcA2o= #Clé publique du serveur vpn
|
||||||
|
Endpoint = 10.121.38.66:51820 #Adresse en dhcp (pont) du serveur vpn avec le port qu'on utilise
|
||||||
|
AllowedIPs = 10.0.0.1/32 #Adresse du serveur vpn
|
1
AP4/onfarbo41/wireguard/wireguard-confsrv/endpoint-a.key
Normal file
1
AP4/onfarbo41/wireguard/wireguard-confsrv/endpoint-a.key
Normal file
@@ -0,0 +1 @@
|
|||||||
|
qKycHr1Ukwzlkw9fI0H4gKbAHpdmwa3HDkWX7rso9Vw=
|
1
AP4/onfarbo41/wireguard/wireguard-confsrv/endpoint-a.pub
Normal file
1
AP4/onfarbo41/wireguard/wireguard-confsrv/endpoint-a.pub
Normal file
@@ -0,0 +1 @@
|
|||||||
|
qxFRWqsOToqCiV3xlCNFh33mDCm0Mb1U/yDukcfcA2o=
|
15
AP4/onfarbo41/wireguard/wireguard-confsrv/wg0.conf
Normal file
15
AP4/onfarbo41/wireguard/wireguard-confsrv/wg0.conf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# local settings for Endpoint A
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = qKycHr1Ukwzlkw9fI0H4gKbAHpdmwa3HDkWX7rso9Vw= #Clé privée du serveur vpn
|
||||||
|
Address = 10.0.0.1/32 #Adresse du serveur vpn
|
||||||
|
ListenPort = 51820
|
||||||
|
|
||||||
|
# remote settings for Endpoint B
|
||||||
|
[Peer]
|
||||||
|
PublicKey = GoHn0zP27+IFPcApQl/Je7EZg2gCrpvr1+Vt6H35AA0= #Clé publique du client
|
||||||
|
AllowedIPs = 10.0.0.2/32 #Adresse vpn du client
|
||||||
|
|
||||||
|
# remote settings for Endpoint C
|
||||||
|
[Peer]
|
||||||
|
PublicKey = e/GFlV6jH219ewqRpNKOKw2SVo/+4g9M5Cz7vZ35JAE= #Clé publique du client
|
||||||
|
AllowedIPs = 10.0.0.3/32 #Adresse vpn du client
|
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-a.key
Normal file
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-a.key
Normal file
@@ -0,0 +1 @@
|
|||||||
|
qKycHr1Ukwzlkw9fI0H4gKbAHpdmwa3HDkWX7rso9Vw=
|
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-a.pub
Normal file
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-a.pub
Normal file
@@ -0,0 +1 @@
|
|||||||
|
qxFRWqsOToqCiV3xlCNFh33mDCm0Mb1U/yDukcfcA2o=
|
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-b.key
Normal file
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-b.key
Normal file
@@ -0,0 +1 @@
|
|||||||
|
KClI53wv5L7AZ9ZOQPNzPqIuQVyfda0VpzLsykuXdXg=
|
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-b.pub
Normal file
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-b.pub
Normal file
@@ -0,0 +1 @@
|
|||||||
|
GoHn0zP27+IFPcApQl/Je7EZg2gCrpvr1+Vt6H35AA0=
|
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-c.key
Normal file
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-c.key
Normal file
@@ -0,0 +1 @@
|
|||||||
|
cD01vjVVw642INlyE+Rmbwf9/Y6Msz6pLTI1zCRjeWM=
|
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-c.pub
Normal file
1
AP4/onfarbo41/wireguard/wireguard-script/endpoint-c.pub
Normal file
@@ -0,0 +1 @@
|
|||||||
|
e/GFlV6jH219ewqRpNKOKw2SVo/+4g9M5Cz7vZ35JAE=
|
15
AP4/onfarbo41/wireguard/wireguard-script/wg0-a.conf
Normal file
15
AP4/onfarbo41/wireguard/wireguard-script/wg0-a.conf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# local settings for Endpoint A
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = qKycHr1Ukwzlkw9fI0H4gKbAHpdmwa3HDkWX7rso9Vw= #Clé privée du serveur vpn
|
||||||
|
Address = 10.0.0.1/32 #Adresse du serveur vpn
|
||||||
|
ListenPort = 51820
|
||||||
|
|
||||||
|
# remote settings for Endpoint B
|
||||||
|
[Peer]
|
||||||
|
PublicKey = GoHn0zP27+IFPcApQl/Je7EZg2gCrpvr1+Vt6H35AA0= #Clé publique du client
|
||||||
|
AllowedIPs = 10.0.0.2/32 #Adresse vpn du client
|
||||||
|
|
||||||
|
# remote settings for Endpoint C
|
||||||
|
[Peer]
|
||||||
|
PublicKey = e/GFlV6jH219ewqRpNKOKw2SVo/+4g9M5Cz7vZ35JAE= #Clé publique du client
|
||||||
|
AllowedIPs = 10.0.0.3/32 #Adresse vpn du client
|
11
AP4/onfarbo41/wireguard/wireguard-script/wg0-b.conf
Normal file
11
AP4/onfarbo41/wireguard/wireguard-script/wg0-b.conf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# local settings for Endpoint B
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = KClI53wv5L7AZ9ZOQPNzPqIuQVyfda0VpzLsykuXdXg= #Clé privée du client
|
||||||
|
Address = 10.0.0.2/32 #Adresse du client
|
||||||
|
ListenPort = 51820
|
||||||
|
|
||||||
|
# remote settings for Endpoint A
|
||||||
|
[Peer]
|
||||||
|
PublicKey = qxFRWqsOToqCiV3xlCNFh33mDCm0Mb1U/yDukcfcA2o= #Clé publique du serveur vpn
|
||||||
|
Endpoint = 10.121.38.66:51820 #Adresse en dhcp (pont) du serveur vpn avec le port qu'on utilise
|
||||||
|
AllowedIPs = 10.0.0.1/32 #Adresse du serveur vpn
|
11
AP4/onfarbo41/wireguard/wireguard-script/wg0-c.conf
Normal file
11
AP4/onfarbo41/wireguard/wireguard-script/wg0-c.conf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# local settings for Endpoint C
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = cD01vjVVw642INlyE+Rmbwf9/Y6Msz6pLTI1zCRjeWM= #Clé privée du client
|
||||||
|
Address = 10.0.0.3/32 #Adresse du client
|
||||||
|
ListenPort = 51820
|
||||||
|
|
||||||
|
# remote settings for Endpoint A
|
||||||
|
[Peer]
|
||||||
|
PublicKey = qxFRWqsOToqCiV3xlCNFh33mDCm0Mb1U/yDukcfcA2o= #Clé publique du serveur vpn
|
||||||
|
Endpoint = 10.121.38.66:51820 #Adresse en dhcp (pont) du serveur vpn avec le port qu'on utilise
|
||||||
|
AllowedIPs = 10.0.0.1/32 #Adresse du serveur vpn
|
7
AP4/onfarbo41/wireguard/wireguard-script/wireguard-init.sh
Executable file
7
AP4/onfarbo41/wireguard/wireguard-script/wireguard-init.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
bash wireguard.sh
|
||||||
|
cp endpoint-a.* wg0-a.conf /etc/wireguard
|
||||||
|
cd /etc/wireguard
|
||||||
|
mv wg0-a.conf wg0.conf
|
||||||
|
systemctl start wg-quick@wg0
|
||||||
|
systemctl enable wg-quick@wg0
|
78
AP4/onfarbo41/wireguard/wireguard-script/wireguard.sh
Executable file
78
AP4/onfarbo41/wireguard/wireguard-script/wireguard.sh
Executable file
@@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -u
|
||||||
|
set -e
|
||||||
|
|
||||||
|
AddressAwg=10.0.0.1/32 # Adresse VPN Wireguard extremite A
|
||||||
|
EndpointA=10.121.38.66 # Adresse extremite A
|
||||||
|
PortA=51820 # Port ecoute extremite A
|
||||||
|
AddressBwg=10.0.0.2/32 # Adresse VPN Wireguard extremite B
|
||||||
|
EndpointB=192.168.2.14 # Adresse extremite B
|
||||||
|
PortB=51820 # Port ecoute extremite B
|
||||||
|
AddressCwg=10.0.0.3/32 # Adresse VPN Wireguard extremite C
|
||||||
|
EndpointC=192.168.2.15 # Adresse extremite C
|
||||||
|
PortC=51820 # Port ecoute extremite C
|
||||||
|
|
||||||
|
umask 077 ;
|
||||||
|
wg genkey > endpoint-a.key
|
||||||
|
wg pubkey < endpoint-a.key > endpoint-a.pub
|
||||||
|
|
||||||
|
wg genkey > endpoint-b.key
|
||||||
|
wg pubkey < endpoint-b.key > endpoint-b.pub
|
||||||
|
|
||||||
|
wg genkey > endpoint-c.key
|
||||||
|
wg pubkey < endpoint-c.key > endpoint-c.pub
|
||||||
|
|
||||||
|
PKA=$(cat endpoint-a.key)
|
||||||
|
pKA=$(cat endpoint-a.pub)
|
||||||
|
PKB=$(cat endpoint-b.key)
|
||||||
|
pKB=$(cat endpoint-b.pub)
|
||||||
|
PKC=$(cat endpoint-c.key)
|
||||||
|
pKC=$(cat endpoint-c.pub)
|
||||||
|
|
||||||
|
cat <<FINI > wg0-a.conf
|
||||||
|
# local settings for Endpoint A
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = $PKA #Clé privée du serveur vpn
|
||||||
|
Address = $AddressAwg #Adresse du serveur vpn
|
||||||
|
ListenPort = $PortA
|
||||||
|
|
||||||
|
# remote settings for Endpoint B
|
||||||
|
[Peer]
|
||||||
|
PublicKey = $pKB #Clé publique du client
|
||||||
|
AllowedIPs = $AddressBwg #Adresse vpn du client
|
||||||
|
|
||||||
|
# remote settings for Endpoint C
|
||||||
|
[Peer]
|
||||||
|
PublicKey = $pKC #Clé publique du client
|
||||||
|
AllowedIPs = $AddressCwg #Adresse vpn du client
|
||||||
|
FINI
|
||||||
|
|
||||||
|
|
||||||
|
cat <<FINI > wg0-b.conf
|
||||||
|
# local settings for Endpoint B
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = $PKB #Clé privée du client
|
||||||
|
Address = $AddressBwg #Adresse du client
|
||||||
|
ListenPort = $PortB
|
||||||
|
|
||||||
|
# remote settings for Endpoint A
|
||||||
|
[Peer]
|
||||||
|
PublicKey = $pKA #Clé publique du serveur vpn
|
||||||
|
Endpoint = ${EndpointA}:$PortA #Adresse en dhcp (pont) du serveur vpn avec le port qu'on utilise
|
||||||
|
AllowedIPs = $AddressAwg #Adresse du serveur vpn
|
||||||
|
FINI
|
||||||
|
|
||||||
|
|
||||||
|
cat <<FINI > wg0-c.conf
|
||||||
|
# local settings for Endpoint C
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = $PKC #Clé privée du client
|
||||||
|
Address = $AddressCwg #Adresse du client
|
||||||
|
ListenPort = $PortC
|
||||||
|
|
||||||
|
# remote settings for Endpoint A
|
||||||
|
[Peer]
|
||||||
|
PublicKey = $pKA #Clé publique du serveur vpn
|
||||||
|
Endpoint = ${EndpointA}:$PortA #Adresse en dhcp (pont) du serveur vpn avec le port qu'on utilise
|
||||||
|
AllowedIPs = $AddressAwg #Adresse du serveur vpn
|
||||||
|
FINI
|
Reference in New Issue
Block a user