Compare commits
No commits in common. "master" and "feat/koha" have entirely different histories.
7 changed files with 11 additions and 85 deletions
18
backup.yml
18
backup.yml
|
@ -1,19 +1,9 @@
|
||||||
---
|
---
|
||||||
- name: Mastodon backup
|
## FRONTEND
|
||||||
|
- name: Test backup
|
||||||
hosts: mastodon
|
hosts: mastodon
|
||||||
roles: ['stable/restic']
|
roles: ['stable/restic']
|
||||||
vars:
|
vars:
|
||||||
restic_dump_compression_enabled: true
|
|
||||||
restic_databases:
|
restic_databases:
|
||||||
- {name: 'mastodon', dump_command: sudo -Hiu postgres pg_dump -Z0 -Fc mastodon}
|
- {name: 'mastodon', dump_command: sudo -Hiu postgres pg_dump -Fc mastodon}
|
||||||
restic_folders: ['/var/lib/redis/dump.rdb','/home/mastodon/live/.env.production']
|
restic_folders: ['/var/lib/redis/dump.rdb','/home/mastodon/live/.env.production']
|
||||||
|
|
||||||
- name: Stereodon Backup
|
|
||||||
hosts: stereodon
|
|
||||||
roles: ['stable/restic']
|
|
||||||
vars:
|
|
||||||
restic_dump_compression_enabled: true
|
|
||||||
restic_databases:
|
|
||||||
- {name: 'stereodon', dump_command: sudo -Hiu postgres pg_dump -Z0 -Fc mastodon}
|
|
||||||
restic_folders: ['/var/lib/redis/dump.rdb','/home/mastodon/live/.env.production']
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
## FRONTEND
|
|
||||||
- name: Frontend
|
|
||||||
hosts: frontend2
|
|
||||||
roles: ['stable/common', 'stable/nginx']
|
|
||||||
vars_files: vars/frontend.yml
|
|
||||||
tags: frontend
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
## FRONTEND
|
## FRONTEND
|
||||||
- name: Frontend
|
- name: Frontend
|
||||||
hosts: frontend2
|
hosts: frontend
|
||||||
roles: ['stable/common', 'stable/nginx']
|
roles: ['stable/common', 'stable/nginx']
|
||||||
vars_files: vars/frontend.yml
|
vars_files: vars/frontend.yml
|
||||||
tags: frontend
|
tags: frontend
|
||||||
|
|
|
@ -13,18 +13,12 @@ cicles:
|
||||||
mastodon:
|
mastodon:
|
||||||
hosts: cisti.mastodon
|
hosts: cisti.mastodon
|
||||||
|
|
||||||
stereodon:
|
|
||||||
hosts: cisti.stereodon
|
|
||||||
|
|
||||||
farma:
|
farma:
|
||||||
hosts: cisti.farma
|
hosts: cisti.farma
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
hosts: cisti.frontend
|
hosts: cisti.frontend
|
||||||
|
|
||||||
frontend2:
|
|
||||||
hosts: cisti.frontend2
|
|
||||||
|
|
||||||
radicale:
|
radicale:
|
||||||
hosts: cisti.cal
|
hosts: cisti.cal
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
- name: Generate certificate if needed
|
- name: Generate certificate if needed
|
||||||
become: yes
|
become: yes
|
||||||
command: /snap/bin/certbot --nginx --non-interactive --agree-tos --expand
|
command: /snap/bin/certbot --nginx --non-interactive --agree-tos
|
||||||
--domains {{ fpm_services | items2dict(key_name='server_name', value_name='server_name') | join(',') }}
|
--domains {{ fpm_services | items2dict(key_name='server_name', value_name='server_name') | join(',') }}
|
||||||
{{ reverse_services | items2dict(key_name='server_name', value_name='server_name') | join(',') }}
|
{{ reverse_services | items2dict(key_name='server_name', value_name='server_name') | join(',') }}
|
||||||
--email {{certbot_email}}
|
--email {{certbot_email}}
|
||||||
|
|
|
@ -7,10 +7,6 @@ User={{ restic_user }}
|
||||||
|
|
||||||
CPUQuota={{ 25 * ansible_processor_vcpus }}%
|
CPUQuota={{ 25 * ansible_processor_vcpus }}%
|
||||||
|
|
||||||
Nice=19
|
|
||||||
IOSchedulingClass=best-effort
|
|
||||||
IOSchedulingPriority=7
|
|
||||||
|
|
||||||
{% if restic_ssh_enabled %}
|
{% if restic_ssh_enabled %}
|
||||||
Environment="RESTIC_REPOSITORY=sftp:{{ restic_ssh_host }}:{{ restic_repository_name }}"
|
Environment="RESTIC_REPOSITORY=sftp:{{ restic_ssh_host }}:{{ restic_repository_name }}"
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -32,7 +28,7 @@ ExecStart={{ restic_path }} backup --verbose {{ folder }}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
|
|
||||||
{% for database in restic_databases %}
|
{% for database in restic_databases %}
|
||||||
ExecStart=/bin/sh -c "{{ database.dump_command }} {{ '| pigz --rsyncable |' if restic_dump_compression_enabled else '|' }} {{ restic_path }} backup --verbose --stdin --stdin-filename {{ database.name }}{{ '.sql.gz' if restic_dump_compression_enabled else '.sql' }}"
|
ExecStart=/bin/sh -c "{{ database.dump_command }} {{ '| pigz |' if restic_dump_compression_enabled else '|' }} {{ restic_path }} backup --verbose --stdin --stdin-filename {{ database.name }}{{ '.sql.gz' if restic_dump_compression_enabled else '.sql' }}"
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
|
|
||||||
{% if restic_forget %}
|
{% if restic_forget %}
|
||||||
|
|
|
@ -1,57 +1,10 @@
|
||||||
---
|
---
|
||||||
with_certbot: true
|
with_certbot: true
|
||||||
certbot_email: info@cisti.org
|
certbot_email: info@cisti.org
|
||||||
reverse_services:
|
servers:
|
||||||
- pad:
|
|
||||||
server_name: pad.cisti.org
|
|
||||||
proxy_pass: http://192.168.200.12:8001
|
|
||||||
|
|
||||||
- gancio:
|
|
||||||
server_name: gancio.cisti.org
|
|
||||||
proxy_pass: http://192.168.200.14:13120
|
|
||||||
custom_config: |
|
|
||||||
sendfile on;
|
|
||||||
client_max_body_size 10m;
|
|
||||||
|
|
||||||
- mastodon:
|
|
||||||
server_name: mastodon.cisti.org
|
|
||||||
proxy_pass: http://192.168.200.13:80
|
|
||||||
custom_config: |
|
|
||||||
sendfile on;
|
|
||||||
client_max_body_size 10m;
|
|
||||||
|
|
||||||
- stereodon:
|
|
||||||
server_name: stereodon.social
|
|
||||||
proxy_pass: http://192.168.200.18:80
|
|
||||||
custom_config: |
|
|
||||||
sendfile on;
|
|
||||||
client_max_body_size 10m;
|
|
||||||
|
|
||||||
- cicles:
|
- cicles:
|
||||||
server_name: cicles.cisti.org
|
server_name: antani.cisti.org
|
||||||
proxy_pass: http://192.168.200.15:8080
|
proxy_pass: http://localhost:8001
|
||||||
custom_config: |
|
custom_config: |
|
||||||
sendfile on;
|
sendfile on;
|
||||||
client_max_body_size 1000m;
|
client_max_body_size 500m;
|
||||||
|
|
||||||
|
|
||||||
## WEB STATICO
|
|
||||||
- cisti:
|
|
||||||
server_name: cisti.org
|
|
||||||
proxy_pass: http://192.168.200.10
|
|
||||||
|
|
||||||
- facciamo:
|
|
||||||
server_name: facciamo.cisti.org
|
|
||||||
proxy_pass: http://192.168.200.10
|
|
||||||
|
|
||||||
- farma:
|
|
||||||
server_name: farma.cisti.org
|
|
||||||
proxy_pass: http://192.168.200.10
|
|
||||||
|
|
||||||
- hackrocchio:
|
|
||||||
server_name: hackrocchio.org
|
|
||||||
proxy_pass: http://192.168.200.10
|
|
||||||
|
|
||||||
- autogestione:
|
|
||||||
server_name: autogestione.social
|
|
||||||
proxy_pass: http://192.168.200.10
|
|
||||||
|
|
Loading…
Reference in a new issue