Start playbook for hetzner's server.

This commit is contained in:
2021-11-21 17:00:58 +01:00
parent 3ee74d46cf
commit bf574c22d5
3 changed files with 47 additions and 0 deletions

19
hetzner.yaml Normal file
View File

@@ -0,0 +1,19 @@
---
# This playbook backups the customers on hetzner server.
- name: Backup hetzner
hosts: all
gather_facts: true
tasks:
- include_vars: vars/hetzner/secret.yaml
- include_vars: vars/hetzner/variable.yaml
- name: Check if directories exist
stat:
path: "{{ backup_dir }}/{{ item }}"
register: dirs
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- debug: var=dirs

7
vars/hetzner/secret.yaml Normal file
View File

@@ -0,0 +1,7 @@
mysql_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30653032393533663237383138653662303937653238323336626431623839323265383536336138
3236353431326238356266613230343333616564383230330a363838633264356263333966613265
65636531363865386134663439616562623430363439613863343831333930363762366432343361
6163373838653762650a346431633230666637306635386262333961646232386262633363643734
65616232363735386461376239303338366537313365316161396262336163653536

View File

@@ -0,0 +1,21 @@
mysql_user: root
backup_dir: /media/backup/docker
systems: ['bookstack', 'gitea', 'kimai', 'nextcloud', 'pihole', 'portainer', 'redis', 'semaphore', 'vaultwarden']
databases1: ['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
maier:
database: c5_maier
ispconfig:
database: dbispconfig
roundcube:
database: roundcube