Compare commits

...

118 Commits

Author SHA1 Message Date
4c7888f0a7 Fix usage of volume variable for hydra storage. 2026-03-27 19:22:24 +00:00
ef7fb78156 Fix missing container variable for hydra db. 2026-03-27 19:20:11 +00:00
d287bbeb53 Create backups for hydra storage. 2026-03-27 19:17:12 +00:00
a94928ec8b Temporary remove the backup deletion. 2026-03-27 19:09:21 +00:00
6b53e8a4e5 Use pause instead of wait_for, as wait_for is not working anymore. 2025-06-26 06:51:53 +00:00
f74c2cec40 Wait for odroid with port 2049 does not work anymore. 2025-06-26 06:47:13 +00:00
a7e86b481a Run odroid backup after cleanup. 2025-05-16 12:09:40 +00:00
774801bb9a rotate-backup.yaml aktualisiert 2025-05-16 12:07:19 +00:00
787b56d7bb Run the backup rotation after semaphore volume. 2025-05-16 12:05:18 +00:00
c281819338 Run semaphore playbook automatically after minisforum playbook. 2025-05-16 12:03:57 +00:00
8ee5b90456 Use external domain for Playbooks. 2025-05-16 12:01:19 +00:00
35b4523939 Use extracted run next playbook. 2025-05-16 11:35:08 +00:00
73b76731ec Use the extracted run-next playbook. 2025-05-16 11:30:47 +00:00
808e9ec055 Extract the run next playbook. 2025-05-16 11:28:36 +00:00
53b7dac530 Correct usage of several var files. 2025-05-16 11:23:37 +00:00
a849ab4dcd Run minisforum as next playbook. 2025-05-16 11:18:04 +00:00
eb1cb2765b Used wrong parameter for uri. 2025-05-16 11:12:06 +00:00
66ad4847d2 Run shutdown after nas backup. 2025-05-16 11:06:18 +00:00
e74974010f Add encrypted token for semaphore integration. 2025-05-16 10:59:27 +00:00
509f534542 Add shutdown playbook. 2025-05-16 10:31:44 +00:00
ac7ca8b944 Rebuild backup to nas to be used from minisforum. 2025-05-16 08:44:54 +00:00
e3aa53fff3 Try wake on lan with explicit ip address. 2025-05-16 07:54:38 +00:00
5d53e2f000 Use broadcast address for wake on lan. 2025-05-16 07:39:36 +00:00
b06e5c67e6 Remove broadcast address to be usable in docker. 2025-05-15 09:35:17 +02:00
b34e455c82 Update backup to nas and remove mattermost variables. 2025-05-15 08:16:44 +02:00
56f2d94e67 Add erechnung steinle to hostinger backup. 2025-05-12 12:16:17 +02:00
cdc6b1397f Add duplicati to backup. 2025-05-08 16:11:55 +02:00
d96332706e Add paperless installation to minisforum backup. 2025-05-07 09:10:28 +02:00
e20371b531 Remove unnecessary playbooks and variables. 2025-05-07 08:23:49 +02:00
8979dd8b5b Remove backup rotation from semaphore play. 2025-05-07 06:11:20 +00:00
302a797ac3 Remove buehler and add gitea to backup. 2025-05-07 06:05:03 +00:00
e4ae52ed22 Remove Mattermost information. 2025-05-05 06:11:07 +00:00
9b3d116cd2 Remove mattermost from backup. 2025-05-05 06:04:29 +00:00
7c3f713c44 Correction of nextclouds password. 2025-04-30 10:47:40 +00:00
826aa655e3 Add more stacks to minisforum playbook. 2025-04-30 10:45:30 +00:00
95e7423c7d Use real names with email addresses. 2025-04-30 10:30:21 +00:00
fe3a4b275a Store homer's volume. 2025-04-30 10:28:59 +00:00
7cbfeb7fcc Integrate Scheidle's kimai backup email. 2025-04-28 13:13:02 +00:00
f2f1591f16 Remove email password from playbook. 2025-04-28 08:21:48 +02:00
f704ea3909 Add email password as vault. 2025-04-28 08:19:56 +02:00
fa1ab6ced8 Remove debug information. 2025-04-28 08:17:26 +02:00
fb620c360d Correct loops in email playbook. 2025-04-28 08:05:10 +02:00
db5cdf58b0 Remove gathering facts and correct loop. 2025-04-28 07:58:06 +02:00
00e7532f66 Use sending emails in hostinger backup. 2025-04-28 07:52:51 +02:00
979f54e4f0 Extract sending emails. 2025-04-28 07:51:28 +02:00
eaaac467aa Fix typo in cleaner playbook. 2025-04-26 12:57:00 +02:00
51a80df646 clean-backup.yaml hinzugefügt 2025-04-25 16:25:49 +02:00
7ea3745030 Remove debug variable from backup rotation. 2025-04-25 15:27:22 +02:00
f0ba691ff8 Build the backup rotation playbook. 2025-04-25 15:25:25 +02:00
7cc6abd942 WIP: Extract backup rotation. 2025-04-25 11:01:47 +02:00
028b6a2e3b Integrate more databases for minisforum backup. 2025-04-25 09:25:49 +02:00
719db38e09 Remove old containers from backup. 2025-04-24 17:36:37 +02:00
42e7bccd2d remove remote backup directory. 2025-04-24 17:10:59 +02:00
aaf0796860 Use correct backup name for database backups. 2025-04-24 17:02:27 +02:00
e0730326b9 No need to gather facts. 2025-04-24 16:57:14 +02:00
fece5c1b9c Change playbook name. 2025-04-24 16:56:28 +02:00
27d83c93c5 Gathering facts in the right place. 2025-04-24 16:55:00 +02:00
06a436fa16 Test with ansible_date_time. 2025-04-24 16:54:09 +02:00
8b35f0575b Test with ansible_date_time. 2025-04-24 16:52:18 +02:00
6eff37e6d1 Correct usage to pass variable. 2025-04-24 16:45:23 +02:00
291b941d2a remove all datetime variables. 2025-04-24 16:44:06 +02:00
2ce9ef04e6 No need to gather facts several times. 2025-04-24 16:41:29 +02:00
750163b29f Correct date variable. 2025-04-24 16:39:42 +02:00
8f0ff03130 Use correct variable syntax. 2025-04-24 16:39:04 +02:00
f772fcef36 Use date variable from parent playbook. 2025-04-24 16:37:39 +02:00
bf8ab6e344 No need to gather facts several times. 2025-04-24 16:37:05 +02:00
a3f19ae110 Use date variable from parent playbook. 2025-04-24 16:36:46 +02:00
c7dc5d8e11 Use date variable in several playbooks. 2025-04-24 16:35:40 +02:00
8d22603a4e Use date variable to use it in several playbooks. 2025-04-24 16:34:57 +02:00
a88e82f0a3 Fetch hostinger backups to local semaphore volume. 2025-04-24 16:28:20 +02:00
6966572f69 Add playbook to fetch remote backups. 2025-04-24 16:23:34 +02:00
7f083782f8 Erweiterung der Backups. 2025-04-24 12:59:13 +02:00
d90d13fea3 Extend hostinger variables to backup svj container. 2025-04-24 12:47:55 +02:00
66537b9988 Remove deprecated variable. 2025-04-24 12:41:25 +02:00
c789d3fb37 Remove deprecated variable. 2025-04-24 12:41:03 +02:00
2b8e01e3e4 Remove ownership of volume backups. 2025-04-24 12:40:36 +02:00
5ef1ec213d Introduce backup of postgres databases. 2025-04-24 12:37:12 +02:00
e6ba644629 Remove owner of directory. 2025-04-24 12:34:01 +02:00
5af5f0b469 Add variables for hostinger. 2025-04-24 12:29:58 +02:00
3cc76a09a9 Add hostinger backup. 2025-04-24 12:25:14 +02:00
3068d39391 Test with external become 2025-04-24 12:22:56 +02:00
776870c73a minisforum.yaml aktualisiert 2025-04-24 12:01:38 +02:00
85c86e6b77 minisforum.yaml aktualisiert 2025-04-24 11:59:32 +02:00
ccd01efd93 minisforum.yaml aktualisiert 2025-04-24 11:59:02 +02:00
07cb86338d Dealing with variables. 2025-04-24 11:51:26 +02:00
9bcff35e0f Try to pass variables to includes playbook. 2025-04-24 11:46:30 +02:00
6e6b73993a Correction of external usage on minisforum. 2025-04-24 11:43:03 +02:00
661119e8fd Use external playbook for minisforum. 2025-04-24 11:41:26 +02:00
572773319d Correct docker backup script. 2025-04-24 11:40:06 +02:00
c5d4f492c3 Extract the backup stuff for further usage. 2025-04-24 11:38:53 +02:00
60a45726d1 Correction of path for volumes ownership on minisforum. 2025-04-24 11:25:11 +02:00
9d2c1a62b2 Change ownership for created volume backups on minisforum. 2025-04-24 11:22:41 +02:00
9a41fefce6 Change volume names for backup on minisforum. 2025-04-24 11:18:00 +02:00
857f04fca9 minisforum.yaml aktualisiert 2025-04-24 11:14:44 +02:00
ef360755f4 Backup container volumes on minisforum. 2025-04-24 11:10:53 +02:00
1773d42761 Start backup of container volumes. 2025-04-24 11:05:21 +02:00
750cfb429b Compress the database backups on minisforum. 2025-04-24 11:00:36 +02:00
f4fd3f44b2 Gather facts to use ansible_date_time on minisforum. 2025-04-24 10:50:01 +02:00
4f6df4cfc8 Create backup for mysql databases on minisforum. 2025-04-24 10:48:02 +02:00
ed16363255 Use explicit database container name to be more flexible. 2025-04-24 10:43:43 +02:00
8915535e20 Add variables for bookstack container. 2025-04-24 10:40:10 +02:00
85e2d92f78 Remove check when creating directories. 2025-04-24 10:32:59 +02:00
2d7af7af21 Create directories for minisforum backup. 2025-04-24 10:29:53 +02:00
cc721c7ee7 First inventory for minisforum. 2025-04-24 10:18:55 +02:00
6155da6236 Use correct variable for minisforum. 2025-04-24 10:07:22 +02:00
a6232e8d4a First test for backup minisforum. 2025-04-24 10:05:40 +02:00
147aec833b vars/odroid.yaml aktualisiert 2025-04-17 20:12:53 +02:00
5883ba179e vars/odroid.yaml aktualisiert 2025-04-17 19:44:24 +02:00
784bcea22c Remove drone from backup. 2025-03-19 08:01:17 +01:00
ed48d52a52 revert 6292b5aac4
revert Remove roundcube from backup.
2024-05-19 11:24:41 +02:00
6292b5aac4 Remove roundcube from backup. 2024-05-17 16:55:00 +02:00
9f5d404947 Update database password for power-consumption stack. 2024-05-04 09:42:13 +02:00
0458e65514 Extend odroid backup to store power-consumption database. 2024-05-03 14:48:35 +02:00
dc8de23804 Cleanup strato-production instead of hetzner. 2024-03-27 08:25:33 +01:00
4c77fc6dc6 Correction of local destination. 2024-03-07 12:23:36 +01:00
eb3a507a3c Adjust local backup file name. 2024-03-07 12:20:12 +01:00
6d0790e8ae Adjust local backup file name. 2024-03-07 12:18:40 +01:00
3c55ca0f1c Adjust local backup directory. 2024-03-07 12:12:49 +01:00
24 changed files with 726 additions and 994 deletions

103
clean-backup.yaml Normal file
View File

@@ -0,0 +1,103 @@
---
# This playbook removes old backups
- name: Cleanup old backups
hosts: all
gather_facts: True
vars:
directories:
- /media/backup/docker
- /media/backup/strato-production
tasks:
- name: Register all backup directories
find:
paths: "{{ item }}"
file_type: directory
recurse: false
register: backup_dirs
loop: "{{ directories }}"
- name: Find old daily backups
find:
paths: "{{ item[1].path }}/daily"
file_type: file
age: 7d
age_stamp: mtime
recurse: false
register: backup_files
loop: "{{ backup_dirs.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Delete old daily backups
file:
path: "{{ item[1].path }}"
state: absent
loop: "{{ backup_files.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Find old weekly backups
find:
paths: "{{ item[1].path }}/weekly"
file_type: file
age: 4w
age_stamp: mtime
recurse: false
register: backup_files
loop: "{{ backup_dirs.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Delete old weekly backups
file:
path: "{{ item[1].path }}"
state: absent
loop: "{{ backup_files.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Find old monthly backups
find:
paths: "{{ item[1].path }}/monthly"
file_type: file
age: 48w
age_stamp: mtime
recurse: false
register: backup_files
loop: "{{ backup_dirs.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Delete old monthly backups
file:
path: "{{ item[1].path }}"
state: absent
loop: "{{ backup_files.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Find old yearly backups
find:
paths: "{{ item[1].path }}/yearly"
file_type: file
age: 156w
age_stamp: mtime
recurse: false
register: backup_files
loop: "{{ backup_dirs.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Delete old yearly backups
file:
path: "{{ item[1].path }}"
state: absent
loop: "{{ backup_files.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Include the run next playbook
import_playbook: run-next.yaml
vars:
to_do: odroid

48
docker-backup.yaml Normal file
View File

@@ -0,0 +1,48 @@
---
# Version 1.1.0
# Encrypt passwords with: "ansible-vault encrypt_string"
# Start playbook with: "ansible-playbook -i localhost, -u chsteinle -k playbook-yaml.yml --ask-vault-pass"
- name: Docker backup
hosts: all
gather_facts: False
tasks:
- name: Create container backup directories
file:
path: "{{ backup_location }}{{ item.name }}"
state: directory
mode: 0755
loop: "{{ containers }}"
loop_control:
label: "{{ item.name }}"
- name: Create backup of mysql database and store to backup directory
shell: docker exec {{ item[1].container }} mysqldump -u{{ item[1].user }} -p{{ item[1].pass }} {{ item[1].name }} > {{ backup_location }}{{ item[0].name }}/{{ item[1].container }}-{{ date }}.sql
when: item[1].type == "mysql"
loop: "{{ containers | subelements('database', skip_missing=True) }}"
loop_control:
label: "{{ item[1].name }}"
- name: Create backup of postgres database and store to backup directory
shell: docker exec {{ item[1].container }} pg_dump -U {{ item[1].user }} {{ item[1].name }} > {{ backup_location }}{{ item[0].name }}/{{ item[1].container }}-{{ date }}.sql
when: item[1].type == "psql"
loop: "{{ containers | subelements('database', skip_missing=True) }}"
loop_control:
label: "{{ item[1].name }}"
- name: Compress all database backup files
shell: gzip {{ backup_location }}{{ item[0].name }}/{{ item[1].container }}-{{ date }}.sql
loop: "{{ containers | subelements('database', skip_missing=True) }}"
loop_control:
label: "{{ item[1].name }}"
- name: Create backup of volume and store to backup directory
shell: tar cfz {{ backup_location }}{{ item[0].name }}/{{ item[1] }}-volume-{{ date }}.tar.gz -C /var/lib/docker/volumes/{{ item[1] }}/ _data
become: yes
become_method: sudo
become_user: root
loop: "{{ containers | subelements('volumes', skip_missing=True) }}"
loop_control:
label: "{{ item[1] }}"

25
email.yaml Normal file
View File

@@ -0,0 +1,25 @@
---
# This playbooks sends email for backups
- name: Send email for backups
hosts: all
gather_facts: false
tasks:
- name: Include email variables
include_vars: vars/email.yaml
- name: Send Email
community.general.mail:
host: mail.steinle-computer.de
port: 465
from: kontakt@steinle-computer.de (Christian Steinle)
username: kontakt@steinle-computer.de
password: "{{ mail_password }}"
to: "{{ item[1] }}"
subject: Datenbank Backup
body: Backup der Anwendung wurde erstellt.
attach:
- "{{ backup_location }}/{{ item[0].name }}/{{ item[0].database[0].container }}-{{ date }}.sql.gz"
loop: "{{ containers | subelements('email', skip_missing=true) }}"
loop_control:
label: "{{ item[1] }}"

26
fetch-backup.yaml Normal file
View File

@@ -0,0 +1,26 @@
---
- name: Fetch remote backups
hosts: all
gather_facts: False
tasks:
- name: Fetch volume backups
fetch:
src: "{{ backup_location }}{{ item[0].name }}/{{ item[1] }}-volume-{{ date }}.tar.gz"
dest: "{{ local_backup }}{{ item[0].name }}/"
flat: yes
loop: "{{ containers | subelements('volumes', skip_missing=True) }}"
loop_control:
label: "{{ item[1] }}"
- name: Fetch database backups
fetch:
src: "{{ backup_location }}{{ item[0].name }}/{{ item[1].container }}-{{ date }}.sql.gz"
dest: "{{ local_backup }}{{ item[0].name }}/"
flat: yes
loop: "{{ containers | subelements('database', skip_missing=True) }}"
loop_control:
label: "{{ item[1].name }}"

View File

@@ -1,96 +0,0 @@
---
# This playbook backups the customers on hetzner server.
- name: Backup hetzner
hosts: all
gather_facts: true
tasks:
- name: Backup hetzner
block:
- include_vars: vars/mattermost.yaml
- include_vars: vars/hetzner.yaml
- name: Create backup directory
file:
path: "{{ backup_dir }}"
state: directory
- name: Create customer directories
file:
path: "{{ backup_dir }}/{{ item.key }}"
state: directory
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Backup web directories
shell: tar cvfz {{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz {{ item. value.storage }}
when: item.value.storage is defined
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Fetch web backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
dest: "{{ local_backup }}/{{ item.key }}/"
flat: yes
when: item.value.storage is defined
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Backup databases
shell: mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item.value.database }} > {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Compress database backups
shell: gzip {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Fetch database backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
dest: "{{ local_backup }}/{{ item.key }}/"
flat: yes
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Clean backup directory
file:
path: "{{ backup_dir }}"
state: absent
- name: Inform Mattermost about success
uri:
url: "{{ mattermost_url }}"
validate_certs: no
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran successful ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ semaphore_token }}"
status_code: [200, 201]
rescue:
- name: Inform Mattermost about error
uri:
url: "{{ mattermost_url }}"
validate_certs: no
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran with error ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ error_token }}"
status_code: [200, 201]

41
hostinger.yaml Normal file
View File

@@ -0,0 +1,41 @@
---
- name: Hostinger backup
hosts: all
gather_facts: True
tasks:
- name: Include container variables
include_vars: vars/hostinger.yaml
- name: Register date
ansible.builtin.set_fact:
date: "{{ ansible_date_time.iso8601_basic_short }}"
- name: Include the docker backup playbook
import_playbook: docker-backup.yaml
vars:
backup_location: "/media/backup/docker/"
containers: containers
date: ansible_facts.date
- name: Include the email playbook
import_playbook: email.yaml
vars:
backup_location: "/media/backup/docker/"
containers: containers
date: ansible_facts.date
- name: Include the fetch backup playbook
import_playbook: fetch-backup.yaml
vars:
local_backup: "/home/semaphore/backup/"
backup_location: "/media/backup/docker/"
containers: containers
date: ansible_facts.date
- name: Include the run next playbook
import_playbook: run-next.yaml
vars:
to_do: minisforum

View File

@@ -1,68 +0,0 @@
---
# This playbook backups database used for volkszaehler.
- name: Backup Mini-Server
hosts: all
gather_facts: true
tasks:
- name: Backup Mini-Server
block:
- include_vars: vars/mattermost.yaml
- include_vars: vars/mini-server.yaml
- name: Create backup directory
file:
path: "{{ backup_dir }}"
state: directory
- name: Backup mysql databases
shell: mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item }} > {{ backup_dir }}/{{ item }}-{{ ansible_date_time.iso8601_basic_short }}.sql
become: yes
become_method: sudo
become_user: root
loop: "{{ databases }}"
- name: Compress database backup files
shell: gzip {{ backup_dir }}/{{ item }}-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ databases }}"
- name: Fetch database backups
fetch:
src: "{{ backup_dir }}/{{ item }}-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
dest: "{{ local_backup }}/{{ item }}-{{ ansible_date_time.iso8601_basic_short }}.sql.gz/"
flat: yes
loop: "{{ databases }}"
- name: Clean backup directory
file:
path: "{{ backup_dir }}"
state: absent
- name: Inform Mattermost about success
uri:
url: "{{ mattermost_url }}"
validate_certs: no
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran successful ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ semaphore_token }}"
status_code: [200, 201]
rescue:
- name: Inform Mattermost about error
uri:
url: "{{ mattermost_url }}"
validate_certs: no
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran with error ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ error_token }}"
status_code: [200, 201]

25
minisforum.yaml Normal file
View File

@@ -0,0 +1,25 @@
---
- name: Minisforum backup
hosts: all
gather_facts: True
tasks:
- name: Include container variables
include_vars: vars/minisforum.yaml
- name: Register date
ansible.builtin.set_fact:
date: "{{ ansible_date_time.iso8601_basic_short }}"
- name: Include the docker play
import_playbook: docker-backup.yaml
vars:
backup_location: "/media/backup/docker/"
containers: containers
date: ansible_facts.date
- name: Include the run next playbook
import_playbook: run-next.yaml
vars:
to_do: semaphore

119
nas.yaml
View File

@@ -1,91 +1,66 @@
---
# This playbook creates a backup of odroid and writes it to the nas.
- name: Backup odroid to nas.
# This playbook creates a backup of minisforum and writes it to odroid.
# Must be run on minisforum
- name: Backup minisforum to odroid
hosts: all
gather_facts: false
vars:
directories:
- docker
- media
- nextcloud
- sftp
- strato-production
gather_facts: true
tasks:
- name: Backup odroid
block:
- include_vars: vars/mattermost.yaml
- name: Include variables
include_vars: vars/semaphore-token.yaml
- name: Wakeup the nas
- name: Wakeup odroid
community.general.wakeonlan:
mac: '54:04:a6:f1:9b:80'
mac: '00:1E:06:45:4C:45'
- name: Wait nas is responding
wait_for_connection:
timeout: 120
delay: 5
sleep: 5
- name: Wait for odroid
ansible.builtin.pause:
minutes: 1
- name: Gathering facts
setup:
# - name: Wait odroid is responding
# ansible.builtin.wait_for:
# host: 192.168.178.56
# port: 2049
- name: Check mount point exists
file:
path: /media/nas
state: directory
- name: Mount nas volume
- name: Mount odroid storage
ansible.posix.mount:
src: 192.168.178.55:/export/data
path: /media/nas
src: 192.168.178.56:/media/backup
path: /media/odroid
state: mounted
fstype: nfs
become: yes
become: true
- name: Backup docker data to nas
shell: rsync -a --delete /media/backup/docker/ /media/nas/Odroid/docker
become: yes
- name: Check backup directory exists
ansible.builtin.file:
path: /media/odroid/minisforum
state: directory
mode: '0755'
- name: Backup hetzner data to nas
shell: rsync -a --delete /media/backup/hetzner/ /media/nas/Odroid/hetzner
become: yes
- name: Check file path for storage directories exists
ansible.builtin.file:
path: /media/odroid/minisforum/{{ item }}
state: directory
mode: '0755'
loop: "{{ directories }}"
- name: Backup nextcloud data to nas
shell: rsync -a --delete /media/backup/nextcloud/ /media/nas/Odroid/nextcloud
become: yes
- name: Backup minisforum directories
ansible.builtin.shell: rsync -a --delete /media/backup/{{ item }}/ /media/odroid/minisforum/{{ item }}/
loop: "{{ directories }}"
- name: Backup media to nas
shell: rsync -a --delete /media/backup/media/ /media/nas/Odroid/media
become: yes
- name: Umount nas volume
- name: Unmount the volume
ansible.posix.mount:
path: /media/nas
path: /media/odroid
state: unmounted
become: yes
become: true
- name: Inform Mattermost about success
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran successful ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ semaphore_token }}"
status_code: [200, 201]
rescue:
- name: Umount nas volume
ansible.posix.mount:
path: /media/nas
state: unmounted
become: yes
- name: Inform Mattermost about error
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran with error ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ error_token }}"
status_code: [200, 201]
- name: Include the run next playbook
import_playbook: run-next.yaml
vars:
to_do: shutdown

View File

@@ -1,293 +0,0 @@
---
# This playbook backups the odroid docker containers.
- name: Backup odroid
hosts: all
gather_facts: true
tasks:
- name: Backup odroid
block:
- include_vars: vars/mattermost.yaml
- include_vars: vars/odroid.yaml
- name: Check if directories exist
stat:
path: "{{ backup_dir }}/{{ item }}"
register: dirs
loop: "{{ systems }}"
- name: Create not existing directories
file:
path: "{{ backup_dir }}/{{ item.item }}"
state: directory
mode: 0755
group: chris
owner: chris
when: item.stat.exists == false
with_items: "{{ dirs.results }}"
loop_control:
label: "{{ item.item }}"
- name: Backup container volumes
shell: docker run --rm -v {{ backup_dir }}/{{ item.value.container }}:/backup --volumes-from {{ item.value.container }} busybox tar cvfz /backup/{{ item.key }}-{{ ansible_date_time.iso8601_basic_short }}.tar.gz {{ item.value.path }}
loop: "{{ lookup('dict', volumes) }}"
loop_control:
label: "{{ item.key }}"
- name: Change ownership of volume backups
file:
path: "{{ backup_dir }}/{{ item.value.container }}/{{ item.key }}-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
owner: chris
group: chris
become: yes
become_method: sudo
become_user: root
loop: "{{ lookup('dict', volumes) }}"
loop_control:
label: "{{ item.key }}"
- name: Backup mysql databases
shell: docker exec {{ item }}-db mysqldump -u{{ item }} -p{{ lookup('vars', item ~ '-password') }} {{ item }} > {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ mysql_databases }}"
- name: Backup postgres databases
shell: docker exec {{ item }}-db pg_dump -U {{ item }} {{ item }} > {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ postgres_databases }}"
- name: Compress database backup files
shell: gzip {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ databases }}"
- name: Check logrotate directories
stat:
path: "{{ backup_dir }}/{{ item[0] }}/{{ item[1] }}"
register: subdirs
with_nested:
- "{{ systems }}"
- ['daily', 'weekly', 'monthly', 'yearly']
loop_control:
label: "{{ item[0] }} {{ item[1] }}"
- name: Create not existing logrotate directories
file:
path: "{{ backup_dir }}/{{ item.item[0] }}/{{ item.item[1] }}"
state: directory
mode: 0755
group: chris
owner: chris
when: item.stat.exists == false
with_items: "{{ subdirs.results }}"
loop_control:
label: "{{ item.item[0] }} {{ item.item[1] }}"
- name: Search for the created backups
find:
paths: "{{ backup_dir }}/{{ item }}"
file_type: file
patterns: '*.gz'
recurse: false
register: backup_files
loop: "{{ systems }}"
- name: Store the yearly backups
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/yearly/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.day == "01" and ansible_date_time.month == "01")
loop_control:
label: "{{ item.path }}"
- name: Store the monthly backups
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/monthly/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.day == "01" and ansible_date_time.month != "01")
loop_control:
label: "{{ item.path }}"
- name: Store the weekly backups
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/weekly/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.weekday_number == "1")
loop_control:
label: "{{ item.path }}"
- name: Store the daily backup
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/daily/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.weekday_number != "1" and ansible_date_time.day != "01")
loop_control:
label: "{{ item.path }}"
- name: Cleanup original backup files
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Find old daily backups
find:
paths: "{{ backup_dir }}/{{ item }}/daily"
file_type: file
age: 8d
age_stamp: ctime
patterns: '*.gz'
recurse: false
register: backup_files
loop: "{{ systems }}"
- name: Delete old daily backups
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Find old weekly backups
find:
paths: "{{ backup_dir }}/{{ item }}/weekly"
file_type: file
age: 5w
age_stamp: ctime
patterns: '*.gz'
recurse: false
register: backup_files
loop: "{{ systems }}"
- name: Delete old weekly backups
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Find old monthly backups
find:
paths: "{{ backup_dir }}/{{ item }}/monthly"
file_type: file
age: 56w
age_stamp: ctime
patterns: '*.gz'
recurse: false
register: backup_files
loop: "{{ systems }}"
- name: Delete old monthly backups
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Search for other servers' backup directories
find:
paths: "/media/backup/{{ item }}"
file_type: directory
recurse: false
register: backup_server_dirs
loop: "{{ servers }}"
- name: Find servers old daily backups
find:
path: "{{ item.path }}/daily"
file_type: file
age: 8d
age_stamp: ctime
patterns: '*.gz'
recurse: false
register: backup_files
with_items: "{{ backup_server_dirs.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Delete servers old daily backups
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Find servers old weekly backups
find:
path: "{{ item.path }}/weekly"
file_type: file
age: 5w
age_stamp: ctime
patterns: '*.gz'
recurse: false
register: backup_files
with_items: "{{ backup_server_dirs.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Delete servers old weekly backups
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Find servers old monthly backups
find:
path: "{{ item.path }}/monthly"
file_type: file
age: 56w
age_stamp: ctime
patterns: '*.gz'
recurse: false
register: backup_files
with_items: "{{ backup_server_dirs.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Delete servers old monthly backups
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Inform Mattermost about success
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran successful ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ semaphore_token }}"
status_code: [200, 201]
rescue:
- name: Inform Mattermost about error
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran with error ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ error_token }}"
status_code: [200, 201]

88
rotate-backup.yaml Normal file
View File

@@ -0,0 +1,88 @@
---
# This playbook rotates backups
- name: Do backup rotation
hosts: all
gather_facts: True
vars:
directories:
- /media/backup/docker
- /media/backup/strato-production
tasks:
- name: Register new backup directories
find:
paths: "{{ item }}"
file_type: directory
recurse: false
register: backup_dirs
loop: "{{ directories }}"
- name: Create the logrotate directories
file:
path: "{{ item[1].path }}/{{ item[2] }}"
state: directory
with_nested:
- "{{ backup_dirs.results | subelements('files') }}"
- ['daily', 'weekly', 'monthly', 'yearly']
loop_control:
label: "{{ item[1].path }} {{ item[2] }}"
- name: Search for new container backups
find:
paths: "{{ item[1].path }}"
file_type: file
patterns: '*.gz'
recurse: false
register: backup_files
loop: "{{ backup_dirs.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Store the yearly backups
copy:
remote_src: true
src: "{{ item[1].path }}"
dest: "{{ item[1].path | dirname }}/yearly/{{ item[1].path | basename }}"
loop: "{{ backup_files.results | subelements('files') if (ansible_date_time.day == '01' and ansible_date_time.month == '01') else [] }}"
loop_control:
label: "{{ item[1].path }}"
- name: Store the monthly backups
copy:
remote_src: true
src: "{{ item[1].path }}"
dest: "{{ item[1].path | dirname }}/monthly/{{ item[1].path | basename }}"
loop: "{{ backup_files.results | subelements('files') if (ansible_date_time.day == '01' and ansible_date_time.month != '01') else [] }}"
loop_control:
label: "{{ item[1].path }}"
- name: Store the weekly backups
copy:
remote_src: true
src: "{{ item[1].path }}"
dest: "{{ item[1].path | dirname }}/weekly/{{ item[1].path | basename }}"
loop: "{{ backup_files.results | subelements('files') if (ansible_date_time.weekday_number == '1' and ansible_date_time.day != '01') else [] }}"
loop_control:
label: "{{ item[1].path }}"
- name: Store the daily backup
copy:
remote_src: true
src: "{{ item[1].path }}"
dest: "{{ item[1].path | dirname }}/daily/{{ item[1].path | basename }}"
loop: "{{ backup_files.results | subelements('files') if (ansible_date_time.weekday_number != '1' and ansible_date_time.day != '01') else [] }}"
loop_control:
label: "{{ item[1].path }}"
- name: Cleanup original backup files
file:
path: "{{ item[1].path }}"
state: absent
loop: "{{ backup_files.results | subelements('files') }}"
loop_control:
label: "{{ item[1].path }}"
- name: Include the run next playbook
import_playbook: run-next.yaml
vars:
to_do: remove

19
run-next.yaml Normal file
View File

@@ -0,0 +1,19 @@
---
# This playbook starts the next semaphore integration
- name: Run next playbook
hosts: all
gather_facts: false
tasks:
- name: Include token
include_vars: vars/semaphore-token.yaml
- name: Run next playbook
ansible.builtin.uri:
url: http://ansible.fam-steinle.de/api/integrations/ei0dtntvuz54ot3s
method: GET
status_code: 204
headers:
Content-Type: application/json
Authorization: Bearer "{{ token }}"
run: "{{ to_do }}"

View File

@@ -5,10 +5,8 @@
gather_facts: true
tasks:
- name: Cleanup semaphore
block:
- include_vars: vars/mattermost.yaml
- include_vars: vars/semaphore.yaml
- name: Include variables
include_vars: vars/semaphore.yaml
- name: Search for volume's backup directories
become: yes
@@ -45,105 +43,7 @@
group: chris
recurse: yes
- name: Register new backup directories
find:
paths: "{{ backup_dir }}"
file_type: directory
recurse: false
register: backup_dirs
- name: Check logrotate directories
file:
path: "{{ item[0].path }}/{{ item[1] }}"
state: directory
with_nested:
- "{{ backup_dirs.files }}"
- ['daily', 'weekly', 'monthly', 'yearly']
loop_control:
label: "{{ item[0].path }} {{ item[1] }}"
- name: Search for the created backups
find:
paths: "{{ item.path }}"
file_type: file
patterns: '*.gz'
recurse: false
register: backup_files
loop: "{{ backup_dirs.files }}"
loop_control:
label: "{{ item.path }}"
- name: Store the yearly backups
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/yearly/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.day == "01" and ansible_date_time.month == "01")
loop_control:
label: "{{ item.path }}"
- name: Store the monthly backups
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/monthly/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.day == "01" and ansible_date_time.month != "01")
loop_control:
label: "{{ item.path }}"
- name: Store the weekly backups
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/weekly/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.weekday_number == "1")
loop_control:
label: "{{ item.path }}"
- name: Store the daily backup
copy:
remote_src: true
src: "{{ item.path }}"
dest: "{{ item.path | dirname }}/daily/{{ item.path | basename }}"
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
when: (ansible_date_time.weekday_number != "1" and ansible_date_time.day != "01")
loop_control:
label: "{{ item.path }}"
- name: Cleanup original backup files
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
loop_control:
label: "{{ item.path }}"
- name: Inform Mattermost about success
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran successful ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ semaphore_token }}"
status_code: [200, 201]
rescue:
- name: Inform Mattermost about error
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran with error ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ error_token }}"
status_code: [200, 201]
- name: Include the run next playbook
import_playbook: run-next.yaml
vars:
to_do: rotate

9
shutdown.yaml Normal file
View File

@@ -0,0 +1,9 @@
---
# This playbook does a shutdown
- name: Shutdown system
hosts: all
gather_facts: true
tasks:
- name: Shutdown nas
ansible.builtin.shell: sudo shutdown -h 1

View File

@@ -1,107 +0,0 @@
---
# This playbook backups the odroid docker containers.
- name: Backup Strato Production
hosts: all
gather_facts: true
tasks:
- name: Backup strato-production
block:
- include_vars: vars/mattermost.yaml
- include_vars: vars/strato-production.yaml
- name: Create backup directory
file:
path: "{{ backup_dir }}"
state: directory
- name: Create customer directories
file:
path: "{{ backup_dir }}/{{ item.key }}"
state: directory
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Backup web directories
shell: tar cvfz {{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz {{ item.value.storage }}
when: item.value.storage is defined
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Fetch web backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
dest: "{{ local_backup }}/{{ item.key }}/"
flat: yes
when: item.value.storage is defined
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Backup mysql databases
shell: docker exec {{ item }}-db mysqldump -u{{ item }} -p{{ lookup('vars', item ~ '-password') }} {{ item }} > {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ mysql_databases }}"
- name: Compress database backup files
shell: gzip {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ databases }}"
- name: Fetch database backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
dest: "{{ local_backup }}/{{ item.key }}/"
flat: yes
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Send Email
community.general.mail:
host: mail.steinle-computer.de
port: 465
from: kontakt@steinle-computer.de (Christian Steinle)
username: kontakt@steinle-computer.de
password: "{{ mail_password }}"
to: "{{ item.value.email }}"
subject: Datenbank Backup
body: Backup der Anwendung wurde erstellt.
attach:
- "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
when: item.value.email is defined
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Clean backup directory
file:
path: "{{ backup_dir }}"
state: absent
- name: Inform Mattermost about success
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran successful ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ semaphore_token }}"
status_code: [200, 201]
rescue:
- name: Inform Mattermost about error
uri:
url: "{{ mattermost_url }}"
method: POST
body_format: json
body:
channel_id: "{{ channel_id }}"
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran with error ({{ ansible_play_name }})"
headers:
Content-Type: application/json
Authorization: "Bearer {{ error_token }}"
status_code: [200, 201]

7
vars/email.yaml Normal file
View File

@@ -0,0 +1,7 @@
mail_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
31373836653662626361323733613833343239373538613061666661353764646131383464396131
3538303939356130373364313331616430643436356533310a376338666538646464616635376263
64363965386239613839393162313965356165613239643863306138623537393235343639376132
3135303633373730370a666333633236343331643666363239376561333365303632326266343966
3036

View File

@@ -1,31 +0,0 @@
ansible_python_interpreter: /usr/bin/python2
mysql_user: root
mysql_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
36616238373963663637653131316238303437333335313831646265636232383736306165373535
3765306364393366316536366136336532303436346139650a316336636161613762353266363866
30613765356432336264633161396536613739653332646561616661663465393161666539626435
3166633663326362610a333064663838666531656265633736333761623439656234303066323136
65396662353166396532633532313061336664653835656439306466336464393164
backup_dir: /var/chris
databases: ['c1_scheidle', 'c1_startup', 'c2_buehler', 'c4_svj', 'c5_maier', 'dbispconfig', 'roundcube']
customers:
scheidle:
database: c1_scheidle
startup:
database: c1_startup
buehler:
database: c2_buehler
svj:
database: c4_svj
storage: /var/www/clients/client4/web4/web/media/svjf
maier:
database: c5_maier
ispconfig:
database: dbispconfig
roundcube:
database: roundcube
local_backup: /home/semaphore/backup

114
vars/hostinger.yaml Normal file
View File

@@ -0,0 +1,114 @@
containers:
- name: erechnung-asu
database:
- type: psql
user: asu
name: asu
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
38316636303230363137653336346264663535393438623339656163303338616666663265666530
6333383135386136643130306434366261363934653931380a633739626464616232376562353934
37623361323039666236663737666437386233393966653935313333303732616537303436616265
6464383237303662620a663633643033653536303464653966363965343536656536353731633966
3232
container: erechnung-asu-pgsql-1
email:
- Florian Maier <maier@arbeitsschutz-ulm.de>
- name: erechnung-steinle
database:
- type: psql
user: steinle
name: steinle
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
61613930656234623537666661626263323661386230326437343033653662643836623838653034
3932656638343037356136623262626637336632336637660a393532653731643332656439363037
39643266343064623939363938316232316433393061393431313034326161393935623163363536
3135353730316333330a646364313738303464373365323533313132343264376139633162663636
6562
container: erechnung-steinle-pgsql-1
- name: gitea
database:
- type: psql
user: gitea
name: gitea
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
61393166333066643632626636343536366437356132613330323738366666356562323339656261
6439633838306230303530666130633035323064613065640a376136333165646237633235343530
32376466323431646636666532343339323762663666336431626636343034613763316132663336
6134336537623638340a616339356538656436353962313932636638353233613463333237376232
65306561393466616664343764636531613764363964653831653234663936353363
container: gitea-db
- name: hydra
database:
- type: psql
user: hydra
name: hydra
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
31393765666565666635646662633066613935316439313862356237353135373164316464333036
3839373230356662356666373831643334393333396163310a386535653961363033343864656665
32343331386134326130643261333563666137333234366539653436333666333266636133616134
3961613332353238320a646334633636363739313034653538343161363334373765363635313163
6332
container: hydra-pgsql-1
volumes:
- hydra-storage
- name: roundcube
database:
- type: mysql
user: roundcube
name: roundcube
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
63626165346530336461393438333731316132366666643334616537323638373362373835656436
6136636561306438323762386663393863303533373464630a346639366539393936646334643732
38383465636536646533363035366335326261323235353664643136393531306464333633636538
3138656666643039610a663663303065313538373865343235313963353865313861323231663631
66656435636263626633356636306636303434323265346333366630383531313637
container: roundcube-db
- name: scheidle
database:
- type: mysql
user: scheidle
name: scheidle
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
30346162333562373233306562626135306530343334663938653661653063363839666266313833
6538373639643435663032323939613464333931623933610a303334316633646164356161313865
65353662346263353537343136663738316132323537663761636535613563336439653935333365
3333373666353232640a323938343030366233326232393164396264343831313834326436336630
62623137363631346263343633663236646537643065353932396334613935633736
container: scheidle-db
email:
- Klaus Scheidle <k.scheidle@scheidle-bauplanung.de>
- name: startup
database:
- type: mysql
user: startup
name: startup
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
32396162326261663939653239386635316536663034653562393833356461363438323430373361
3465373962666332346331636634376264346239353930320a336666623734383534306564383430
33316432303735376334313966323033393338383066393239663636323962373835393633366333
3965623064313539330a613665343566663865663436363263366637353034623337343834663164
34616635346533633666316534633737326138636533363366643238373736336562393664646337
6661313163303331336163303464373666633266363866336133
container: startup-db
- name: svj
database:
- type: mysql
user: svj
name: svj
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
64386230373266663734633264613839623135323335313934373264393764353338323430313131
3131616663616461306366373138626439363064616237380a613465663335373063663830656638
31316433653265313733393862653634666261643865363364323165326139323230633838366339
3731613934383064310a666338373530633136336362646139373633323139333738363061393562
38653231333437653066346465633635336663643137363431326239333135616230
container: svj-db
volumes:
- svj-media

View File

@@ -1,22 +0,0 @@
mattermost_url: https://cs-mm.ddnss.de/api/v4/posts
channel_id: !vault |
$ANSIBLE_VAULT;1.1;AES256
39653833613461333664643534613839663837373932333262346338653366363734643361383931
3632326236393064616566653336333830356135376530320a353135616533303632663432383663
62643264356135363064353666353736666330393035643139333833306463646365356563313862
3662363932666164650a393834376463366537323066393262663730383337636636633439653437
32313635326439373234313565633035306166323935363336326231316533386538
semaphore_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
63313433633333393362306534636131666536313365353439343764623132616537663838353238
3536376438343865376539336235366138303762663732370a303532306533613838383037633138
39383139656231373237333434653932663361393063313962383831356134653866313539373235
3564373132346262640a316463333735393534346436313838336439373839643535646262366339
34663863383264393638316434333764643263623536386262643431613630333539
error_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
37376437373233373664323163346661663336656636316365343732383130626339363032393035
3831633664373835663933333533303031626135303139380a396439393762316430333035373233
64623137643433353537306436333665313864373634353032346366613037336437343239643661
3665646265326435650a373561663637366266613933376636313830313937306362653864376439
66313761646362323634343139316235353639643830366130653238306232353631

View File

@@ -1,12 +0,0 @@
mysql_user: root
mysql_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
36326232633139633763643864663666616165663135646530666435313362316463663630346462
3261653735613434633134623639313135373466633038370a613235313062343737636661363561
32306530666265336535376534633937303931653566313761663564653263326365353766376232
3065376433323530310a666466313638623163663435383533313537633238373737353131366139
6566
backup_dir: /home/chris/backup
databases: ['volkszaehler']
local_backup: /media/backup/miniserver

123
vars/minisforum.yaml Normal file
View File

@@ -0,0 +1,123 @@
containers:
- name: bookstack
volumes:
- bookstack
database:
- type: mysql
user: bookstack
name: bookstack
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
39323365326263383530663265646530333164303933313431376532346164353633323465383632
6662353365613637306166313730363065393663353238350a373831346263316231353831616662
65626233653164356439616239373834333132336463636662313465363666653361633765306232
3337366461306433380a376265346538373635393662373239303534346532626433346233643666
32663061343035323965366663666564376161333430656664663038663539373035
container: bookstack-db
- name: consumption
database:
- type: mysql
user: consumption
name: consumption
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
62653565313030643662323931636366323433643562356664376331313039333633643234613363
3835383832626636323166623932363366333165613431660a303662303936303866346566623561
34613230636564666466303963333239313061633363383631333965623434316134303939623366
3465613532613537380a353332666330306466336561666630383635636163623530656235306662
3366
container: consumption-db
- name: duplicati
volumes:
- duplicati-conf
- name: gitea
database:
- type: psql
user: gitea
name: gitea
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
35386139336366356138376663316634626663656234333932363865613339383338653864396237
6266356438393366623238656266373732613739333334300a636630626630323731326565303264
62316336383333333063626665323063613530616132363537343139633765626231393932656233
3931376265346362610a383438643662663834353663366231643261323964323434363463346436
64626135373938636265616532373531626565393438633537646361646663326365
container: gitea-db
- name: homer
volumes:
- homer
- name: kimai
database:
- type: mysql
user: kimai
name: kimai
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
65333334616333326464643264343430303937613362323432646136303932663164316134623063
6636646534396635303635313137386634636263376532630a306131376437383365326136373437
30326338373236363662623163646438306637626166353438613434353666616338653730343534
6537326238336161620a336564386633623335333562333966636462626461383131613137326464
63306230316662353865386333383536633938343937663162643664333765303761
container: kimai-db
- name: nextcloud
database:
- type: psql
user: nextcloud
name: nextcloud
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
34636539383237653564393232316363303062626566303963313634636637623034366262633966
3561333039623330353435333130653664336431366165380a626634353832623366633135353962
30393265643365383461373236363962636564333639633266336133313431303937663736356632
3666633031366538380a656434643766313762366665666633633932623434303532336361646635
31623738623261373366393939613765363033313761666361313364326435303837
container: nextcloud-db
volumes:
- nextcloud-config
- name: paperless
database:
- type: psql
user: paperless
name: paperless
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
38653531613330356263363366323264626437336537323161633031306339623435333132626436
3433306334663737323863386236323365613239623137320a356632613566393934656266616535
37616461336235303064653432323164616132636532623261306138333063326235336437643135
6332373833653862320a386565633436323739363266323163386633363965303262326339663564
6265
container: paperless-db-1
volumes:
- paperless_paperless-data
- paperless_paperless-export
- paperless_paperless-media
- name: semaphore
database:
- type: mysql
user: semaphore
name: semaphore
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
65393034313732656364303764323665616165636365343232323766363535323639353936366265
6334346130303739626635383138393832653334626536390a313964326337613635383564343465
35363336396339323565306439613964343632373939333238656134303235636639656465353362
3261356535383164610a643666363635666231343634353539326137343461646365303237653733
63393438616332623234623137343333383533393434343437623065386461373564
container: semaphore-db
- name: vault
volumes:
- vault
- name: vz
database:
- type: mysql
user: vz
name: vz
pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
62653565313030643662323931636366323433643562356664376331313039333633643234613363
3835383832626636323166623932363366333165613431660a303662303936303866346566623561
34613230636564666466303963333239313061633363383631333965623434316134303939623366
3465613532613537380a353332666330306466336561666630383635636163623530656235306662
3366
container: vz-db

View File

@@ -1,86 +0,0 @@
backup_dir: /media/backup/docker
systems: ['bookstack', 'drone', 'duplicati', 'gitea', 'kimai', 'mattermost', 'nextcloud', 'pihole', 'portainer', 'semaphore', 'vaultwarden']
databases: ['bookstack', 'drone', 'gitea', 'kimai', 'mattermost', 'nextcloud', 'semaphore']
mysql_databases: ['bookstack', 'kimai', 'semaphore']
postgres_databases: ['drone', 'gitea', 'mattermost', 'nextcloud']
bookstack-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
33396131646266346635316538663337376432366135636166636332653431663834613139663766
3633626536616462316434373632656330643563323835320a303163393034333439313236393531
66343539653835643733303333343466326532663837343636326339366333316335313538316331
3732306231396535630a633162653539643132643063373730316462646662636364353734363932
38303464363437666534306233393233323363383033323134363930396364303462
drone-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
33326532336464663338346165346636393633666434333135353230643235616339373436366365
3937303132366632623739653639323830393564643234370a376262373863636638366464613665
64336331613561326334613731303237643562343631616161636165383735653636386166316166
6236386333623731660a343363323566383634383430326261333031346533663737326530666363
37353332383862646262646361333238363261313632336438393230336662616462
gitea-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
35386139336366356138376663316634626663656234333932363865613339383338653864396237
6266356438393366623238656266373732613739333334300a636630626630323731326565303264
62316336383333333063626665323063613530616132363537343139633765626231393932656233
3931376265346362610a383438643662663834353663366231643261323964323434363463346436
64626135373938636265616532373531626565393438633537646361646663326365
kimai-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
65333334616333326464643264343430303937613362323432646136303932663164316134623063
6636646534396635303635313137386634636263376532630a306131376437383365326136373437
30326338373236363662623163646438306637626166353438613434353666616338653730343534
6537326238336161620a336564386633623335333562333966636462626461383131613137326464
63306230316662353865386333383536633938343937663162643664333765303761
mattermost-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30633262316262313463383737353134306463613838383937366364343163376235333266326561
3036656433613465653534376530333137346461323732330a653362643338356265646536303635
39613063623037363938356461383638353639616661326237336661613631633563313135363838
6363373661653034350a386365643566373964343332623231396331666634303235313366356663
39653261373363323633336361303866386365373931653538353938643265613665
nextcloud-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
34636539383237653564393232316363303062626566303963313634636637623034366262633966
3561333039623330353435333130653664336431366165380a626634353832623366633135353962
30393265643365383461373236363962636564333639633266336133313431303937663736356632
3666633031366538380a656434643766313762366665666633633932623434303532336361646635
31623738623261373366393939613765363033313761666361313364326435303837
semaphore-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
65393034313732656364303764323665616165636365343232323766363535323639353936366265
6334346130303739626635383138393832653334626536390a313964326337613635383564343465
35363336396339323565306439613964343632373939333238656134303235636639656465353362
3261356535383164610a643666363635666231343634353539326137343461646365303237653733
63393438616332623234623137343333383533393434343437623065386461373564
volumes:
bookstack:
container: bookstack
path: /config
dnsmasq:
container: pihole
path: /etc/dnsmasq.d
duplicati-conf:
container: duplicati
path: /data
gitea:
container: gitea
path: /data
kimai-var:
container: kimai
path: /opt/kimai/var
mattermost:
container: mattermost
path: /mattermost/data
nextcloud-config:
container: nextcloud
path: /var/www/html/config
pihole:
container: pihole
path: /etc/pihole
portainer:
container: portainer
path: /data
vault:
container: vaultwarden
path: /data
servers: ['hetzner']

View File

@@ -0,0 +1,8 @@
token: !vault |
$ANSIBLE_VAULT;1.1;AES256
65356164613865333362643539356565303536323764396634613937663636313965313938366261
3530343637636563636234333362393638633862346362650a626131363438303265653166313334
35663835313931343635636162383537663561303039356236633764643435353336353336616565
6135366236343439620a646637636633643465306434633730313634616461663538313164653536
65313932383064623935366531376130356663343261393165636338636562333830643531613263
3138633663623730643532313461666262383362313439643239

View File

@@ -1,64 +0,0 @@
backup_dir: /media/backup/strato-production
systems: ['buehler', 'scheidle', 'roundcube', 'startup', 'svj']
databases: ['buehler', 'scheidle', 'roundcube', 'startup', 'svj']
mysql_databases: ['buehler', 'scheidle', 'roundcube', 'startup', 'svj']
local_backup: /home/semaphore/backup
mail_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
31373836653662626361323733613833343239373538613061666661353764646131383464396131
3538303939356130373364313331616430643436356533310a376338666538646464616635376263
64363965386239613839393162313965356165613239643863306138623537393235343639376132
3135303633373730370a666333633236343331643666363239376561333365303632326266343966
3036
buehler-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
37306230376433313631326230313739396238666239323362366164363831643664306535346464
3161643933633336366364636534333662383731376633300a303666373565356564323361346636
63366162336662636266613235643335323835613838663839383433656362366566336637353938
3961633364303334330a363136373931396536623836303833666431393932316636396432346232
66643031663162373838333434616462333465316134626238306334633439643734336561396531
6531316263333335626662656139303235313137666162326138
scheidle-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30346162333562373233306562626135306530343334663938653661653063363839666266313833
6538373639643435663032323939613464333931623933610a303334316633646164356161313865
65353662346263353537343136663738316132323537663761636535613563336439653935333365
3333373666353232640a323938343030366233326232393164396264343831313834326436336630
62623137363631346263343633663236646537643065353932396334613935633736
roundcube-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
63626165346530336461393438333731316132366666643334616537323638373362373835656436
6136636561306438323762386663393863303533373464630a346639366539393936646334643732
38383465636536646533363035366335326261323235353664643136393531306464333633636538
3138656666643039610a663663303065313538373865343235313963353865313861323231663631
66656435636263626633356636306636303434323265346333366630383531313637
startup-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
32396162326261663939653239386635316536663034653562393833356461363438323430373361
3465373962666332346331636634376264346239353930320a336666623734383534306564383430
33316432303735376334313966323033393338383066393239663636323962373835393633366333
3965623064313539330a613665343566663865663436363263366637353034623337343834663164
34616635346533633666316534633737326138636533363366643238373736336562393664646337
6661313163303331336163303464373666633266363866336133
svj-password: !vault |
$ANSIBLE_VAULT;1.1;AES256
64386230373266663734633264613839623135323335313934373264393764353338323430313131
3131616663616461306366373138626439363064616237380a613465663335373063663830656638
31316433653265313733393862653634666261643865363364323165326139323230633838366339
3731613934383064310a666338373530633136336362646139373633323139333738363061393562
38653231333437653066346465633635336663643137363431326239333135616230
customers:
buehler:
database: buehler
storage: /var/lib/docker/volumes/buehler-storage/_data
scheidle:
database: scheidle
email: Klaus Scheidle <k.scheidle@scheidle-bauplanung.de>
roundcube:
database: roundcube
startup:
database: startup
svj:
database: svj
storage: /var/lib/docker/volumes/svj-media/_data