add archives mail

This commit is contained in:
rick 2022-06-25 01:31:56 +02:00
parent b4dea966fc
commit 09f7e02520
Signed by: Rick
GPG key ID: 4A6223D66294EB20
5 changed files with 87 additions and 0 deletions

View file

@ -51,6 +51,7 @@
- libretls
- cgit
- site
- bubger
post_tasks:
- name: démarrage par défaut de nginx

View 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

View 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;
}
}

View 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 }}"

View file

@ -3,5 +3,6 @@ site: ""
cgit_site: ""
user_default: "ubuntu"
home_user_default: "/home/{{ user_default }}"
ava: "/etc/nginx/sites-available"
ena: "/etc/nginx/sites-enabled"