add archives mail
This commit is contained in:
parent
b4dea966fc
commit
09f7e02520
5 changed files with 87 additions and 0 deletions
1
main.yml
1
main.yml
|
@ -51,6 +51,7 @@
|
||||||
- libretls
|
- libretls
|
||||||
- cgit
|
- cgit
|
||||||
- site
|
- site
|
||||||
|
- bubger
|
||||||
|
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: démarrage par défaut de nginx
|
- name: démarrage par défaut de nginx
|
||||||
|
|
60
roles/bubger/tasks/main.yml
Normal file
60
roles/bubger/tasks/main.yml
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
################################################################################
|
||||||
|
# création des dossiers pour les archives mails
|
||||||
|
#
|
||||||
|
# Copyright (C) 2022 rick G. <rick@gnous.eu>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation, either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
---
|
||||||
|
- name: installation des paquets nécessaires
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- rsync
|
||||||
|
|
||||||
|
- name: création dossier principal
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ path }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: création des sous dossiers
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ public }}"
|
||||||
|
- "{{ private }}"
|
||||||
|
|
||||||
|
- name: lien symbolique pour le dossier publique
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: "{{ public }}"
|
||||||
|
dest: "{{ path_site_public }}"
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: lien symbolique pour le dossier privé
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: "{{ private }}"
|
||||||
|
dest: "{{ path_site_private }}"
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: configuration de Nginx
|
||||||
|
template:
|
||||||
|
src: "archives-nginx"
|
||||||
|
dest: "{{ ava }}/archives.conf"
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: lien symbolique pour Nginx
|
||||||
|
file:
|
||||||
|
src: "{{ ava }}/archives.conf"
|
||||||
|
dest: "{{ ena }}/archives.conf"
|
||||||
|
state: link
|
17
roles/bubger/templates/archives-nginx
Normal file
17
roles/bubger/templates/archives-nginx
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
server {
|
||||||
|
server_name {{ site }};
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
root {{ path_site }};
|
||||||
|
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
location /archives {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /{{ private_name }} {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
}
|
8
roles/bubger/vars/main.yml
Normal file
8
roles/bubger/vars/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
private_name: ""
|
||||||
|
path: "{{ home_user_default }}/bubger"
|
||||||
|
path_site: "/var/www/mailings_list"
|
||||||
|
path_site_public: "{{ path_site }}/archives"
|
||||||
|
path_site_private: "{{ path_site }}/{{ private_name }}"
|
||||||
|
public: "{{ path }}/archives"
|
||||||
|
private: "{{ path }}/{{ private_name }}"
|
|
@ -3,5 +3,6 @@ site: ""
|
||||||
cgit_site: ""
|
cgit_site: ""
|
||||||
|
|
||||||
user_default: "ubuntu"
|
user_default: "ubuntu"
|
||||||
|
home_user_default: "/home/{{ user_default }}"
|
||||||
ava: "/etc/nginx/sites-available"
|
ava: "/etc/nginx/sites-available"
|
||||||
ena: "/etc/nginx/sites-enabled"
|
ena: "/etc/nginx/sites-enabled"
|
||||||
|
|
Loading…
Reference in a new issue