mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-10 07:38:34 +01:00
feat: backup+mail
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
- hosts: backup
|
- hosts: backup
|
||||||
roles:
|
roles:
|
||||||
- { role : backup, tags : [ "backup" ] }
|
- { role : backup-vm, tags : [ "backup" ] }
|
||||||
|
|
||||||
- hosts: kube1
|
- hosts: kube1
|
||||||
roles:
|
roles:
|
||||||
|
|||||||
19
roles/backup-vm/files/vsyncdir.conf
Normal file
19
roles/backup-vm/files/vsyncdir.conf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[general]
|
||||||
|
status_path = "~/.vdirsyncer/status/"
|
||||||
|
|
||||||
|
[pair ths_caldav]
|
||||||
|
a = "ths_remote_caldav"
|
||||||
|
b = "ths_local_caldav"
|
||||||
|
collections = ["from a"]
|
||||||
|
|
||||||
|
[storage ths_remote_caldav]
|
||||||
|
type = "caldav"
|
||||||
|
read_only = true
|
||||||
|
url = "https://ths.atlantishq.de/remote.php/dav/calendars/backup/ths_shared_by_ths/"
|
||||||
|
username = "backup"
|
||||||
|
password = "HISTORY_PURGED_SECRET"
|
||||||
|
|
||||||
|
[storage ths_local_caldav]
|
||||||
|
type = "filesystem"
|
||||||
|
path = "~/ths-caldav/"
|
||||||
|
fileext = ".ics"
|
||||||
32
roles/backup-vm/tasks/main.yaml
Normal file
32
roles/backup-vm/tasks/main.yaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
- name: Install tools
|
||||||
|
apt:
|
||||||
|
pkg:
|
||||||
|
- zip
|
||||||
|
- vdirsyncer
|
||||||
|
|
||||||
|
- name: Copy Backup caldav script
|
||||||
|
copy:
|
||||||
|
src: ths_cal_backup.sh
|
||||||
|
dest: /home/sheppy/ths_cal_backup.sh
|
||||||
|
owner: sheppy
|
||||||
|
group: sheppy
|
||||||
|
|
||||||
|
- name: Copy vdirsync config
|
||||||
|
copy:
|
||||||
|
src: vsyncdir.conf
|
||||||
|
dest: /home/sheppy/vsyncdir.conf
|
||||||
|
owner: sheppy
|
||||||
|
group: sheppy
|
||||||
|
|
||||||
|
- name: Create backups dir
|
||||||
|
file:
|
||||||
|
path: /home/sheppy/backups/
|
||||||
|
state: directory
|
||||||
|
owner: sheppy
|
||||||
|
group: sheppy
|
||||||
|
|
||||||
|
- name: Clone backup tools
|
||||||
|
git:
|
||||||
|
repo: https://github.com/FAUSheppy/backup-tools
|
||||||
|
dest: /home/sheppy/backups/backup-tools/
|
||||||
|
version: master
|
||||||
@@ -20,6 +20,21 @@
|
|||||||
name: influxdb
|
name: influxdb
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
|
- name: restart postfix
|
||||||
|
systemd:
|
||||||
|
name: postfix
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: restart dovecot
|
||||||
|
systemd:
|
||||||
|
name: dovecot
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: restart nginx
|
||||||
|
systemd:
|
||||||
|
name: nginx
|
||||||
|
state: restarted
|
||||||
|
|
||||||
- name: daemon reload
|
- name: daemon reload
|
||||||
systemd:
|
systemd:
|
||||||
daemon-reload: yes
|
daemon-reload: yes
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
# Sender adress the user may use :)
|
# Sender adress the user may use :)
|
||||||
HISTORY_PURGED_SECRET HISTORY_PURGED_SECRET
|
HISTORY_PURGED_SECRET HISTORY_PURGED_SECRET
|
||||||
check@atlantishq.de check@atlantishq.de,HISTORY_PURGED_SECRET
|
|
||||||
test@atlantishq.de check@atlantishq.de
|
|
||||||
joerg@darknet-fashion.de joerg@darknet-fashion.de
|
joerg@darknet-fashion.de joerg@darknet-fashion.de
|
||||||
HISTORY_PURGED_SECRET HISTORY_PURGED_SECRET
|
HISTORY_PURGED_SECRET HISTORY_PURGED_SECRET
|
||||||
@darknet-fashion.de joerg
|
@darknet-fashion.de joerg
|
||||||
|
|||||||
63
roles/mail/files/nginx.conf
Normal file
63
roles/mail/files/nginx.conf
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
user www-data;
|
||||||
|
worker_processes auto;
|
||||||
|
pid /run/nginx.pid;
|
||||||
|
include /etc/nginx/modules-enabled/*.conf;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 768;
|
||||||
|
# multi_accept on;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
|
||||||
|
##
|
||||||
|
# Basic Settings
|
||||||
|
##
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
tcp_nopush on;
|
||||||
|
types_hash_max_size 2048;
|
||||||
|
# server_tokens off;
|
||||||
|
|
||||||
|
# server_names_hash_bucket_size 64;
|
||||||
|
# server_name_in_redirect off;
|
||||||
|
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
##
|
||||||
|
# SSL Settings
|
||||||
|
##
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/atlantishq.de/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/atlantishq.de/privkey.pem;
|
||||||
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
|
||||||
|
ssl_prefer_server_ciphers on;
|
||||||
|
|
||||||
|
##
|
||||||
|
# Logging Settings
|
||||||
|
##
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
|
##
|
||||||
|
# Gzip Settings
|
||||||
|
##
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
|
||||||
|
# gzip_vary on;
|
||||||
|
# gzip_proxied any;
|
||||||
|
# gzip_comp_level 6;
|
||||||
|
# gzip_buffers 16 8k;
|
||||||
|
# gzip_http_version 1.1;
|
||||||
|
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
|
##
|
||||||
|
# Virtual Host Configs
|
||||||
|
##
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
include /etc/nginx/sites-enabled/*;
|
||||||
|
}
|
||||||
2
roles/mail/meta/main.yml
Normal file
2
roles/mail/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- global-handlers
|
||||||
@@ -2,15 +2,16 @@
|
|||||||
apt:
|
apt:
|
||||||
pkg:
|
pkg:
|
||||||
- postfix
|
- postfix
|
||||||
- dovecot
|
- dovecot-core
|
||||||
|
- dovecot-imapd
|
||||||
- spamassassin
|
- spamassassin
|
||||||
- nginx
|
- nginx
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Deploy Postfix config
|
- name: Deploy Postfix config
|
||||||
file:
|
copy:
|
||||||
src: {{ item }}
|
src: "{{ item }}"
|
||||||
dest: /etc/postfix/{{ item }}
|
dest: "/etc/postfix/{{ item }}"
|
||||||
with_items:
|
with_items:
|
||||||
- dynamicmaps.cf
|
- dynamicmaps.cf
|
||||||
- enabled_senders
|
- enabled_senders
|
||||||
@@ -24,21 +25,21 @@
|
|||||||
notify: restart postfix
|
notify: restart postfix
|
||||||
|
|
||||||
- name: Deploy Dovecot config
|
- name: Deploy Dovecot config
|
||||||
file:
|
copy:
|
||||||
src: {{ item }}
|
src: "{{ item }}"
|
||||||
dest: /etc/dovecot/{{ item }}
|
dest: "/etc/dovecot/{{ item }}"
|
||||||
with_items:
|
with_items:
|
||||||
- dovecot.conf
|
- dovecot.conf
|
||||||
notify: restart dovecot
|
notify: restart dovecot
|
||||||
|
|
||||||
- name: Deploy nginx-config
|
- name: Deploy nginx-config
|
||||||
file:
|
copy:
|
||||||
src: nginx.conf
|
src: nginx.conf
|
||||||
dest: /etc/nginx/nginx.conf
|
dest: /etc/nginx/nginx.conf
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
|
|
||||||
- name: Deploy nginx-config (page)
|
- name: Deploy nginx-config (page)
|
||||||
file:
|
copy:
|
||||||
src: nginx_default.conf
|
src: nginx_default.conf
|
||||||
dest: /etc/nginx/sites-available/default
|
dest: /etc/nginx/sites-available/default
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
|
|||||||
Reference in New Issue
Block a user