Add backup of files
This commit is contained in:
parent
8054421d2a
commit
b4c4ea1cfd
1 changed files with 16 additions and 5 deletions
|
@ -8,6 +8,7 @@
|
||||||
copy:
|
copy:
|
||||||
dest: /etc/docker/daemon.json
|
dest: /etc/docker/daemon.json
|
||||||
content: "{{ docker_daemon_settings|to_json(indent=4, sort_keys=True) }}"
|
content: "{{ docker_daemon_settings|to_json(indent=4, sort_keys=True) }}"
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Configure docker service and reload it
|
- name: Configure docker service and reload it
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -67,6 +68,7 @@
|
||||||
copy:
|
copy:
|
||||||
src: files/Dockerfile
|
src: files/Dockerfile
|
||||||
dest: "{{ mastodon_composer_folder }}/Dockerfile"
|
dest: "{{ mastodon_composer_folder }}/Dockerfile"
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Ensure mastodon folder exists
|
- name: Ensure mastodon folder exists
|
||||||
file:
|
file:
|
||||||
|
@ -77,12 +79,14 @@
|
||||||
template:
|
template:
|
||||||
src: templates/docker-compose.yml.j2
|
src: templates/docker-compose.yml.j2
|
||||||
dest: "{{ mastodon_composer_folder }}/docker-compose.yml"
|
dest: "{{ mastodon_composer_folder }}/docker-compose.yml"
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Ensure mastodon environment configuration is present
|
- name: Ensure mastodon environment configuration is present
|
||||||
template:
|
template:
|
||||||
src: templates/env.j2
|
src: templates/env.j2
|
||||||
dest: "{{ mastodon_composer_folder }}/env.production"
|
dest: "{{ mastodon_composer_folder }}/env.production"
|
||||||
mode: 0600
|
mode: 0600
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Generate secret key
|
- name: Generate secret key
|
||||||
shell: docker-compose run --rm web bundle exec rake secret
|
shell: docker-compose run --rm web bundle exec rake secret
|
||||||
|
@ -101,7 +105,7 @@
|
||||||
path: "{{ mastodon_composer_folder }}/env.production"
|
path: "{{ mastodon_composer_folder }}/env.production"
|
||||||
line: "SECRET_KEY_BASE={{ mastodon_secret_key_base }}"
|
line: "SECRET_KEY_BASE={{ mastodon_secret_key_base }}"
|
||||||
regexp: "^SECRET_KEY_BASE="
|
regexp: "^SECRET_KEY_BASE="
|
||||||
backup: yes
|
backup: true
|
||||||
mode: 0600
|
mode: 0600
|
||||||
|
|
||||||
- name: Generate OTP secret key
|
- name: Generate OTP secret key
|
||||||
|
@ -121,7 +125,7 @@
|
||||||
path: "{{ mastodon_composer_folder }}/env.production"
|
path: "{{ mastodon_composer_folder }}/env.production"
|
||||||
line: "OTP_SECRET={{ mastodon_otp_secret }}"
|
line: "OTP_SECRET={{ mastodon_otp_secret }}"
|
||||||
regexp: "^OTP_SECRET="
|
regexp: "^OTP_SECRET="
|
||||||
backup: yes
|
backup: true
|
||||||
mode: 0600
|
mode: 0600
|
||||||
|
|
||||||
- name: Generate Paperclip secret key
|
- name: Generate Paperclip secret key
|
||||||
|
@ -141,7 +145,7 @@
|
||||||
path: "{{ mastodon_composer_folder }}/env.production"
|
path: "{{ mastodon_composer_folder }}/env.production"
|
||||||
line: "PAPERCLIP_SECRET={{ mastodon_paperclip_secret }}"
|
line: "PAPERCLIP_SECRET={{ mastodon_paperclip_secret }}"
|
||||||
regexp: "^PAPERCLIP_SECRET="
|
regexp: "^PAPERCLIP_SECRET="
|
||||||
backup: yes
|
backup: true
|
||||||
mode: 0600
|
mode: 0600
|
||||||
|
|
||||||
- name: Generate VAPID keypair
|
- name: Generate VAPID keypair
|
||||||
|
@ -167,7 +171,7 @@
|
||||||
line: "{{ vapid_private_key }}"
|
line: "{{ vapid_private_key }}"
|
||||||
regexp: "^VAPID_PRIVATE_KEY="
|
regexp: "^VAPID_PRIVATE_KEY="
|
||||||
mode: 0600
|
mode: 0600
|
||||||
backup: yes
|
backup: true
|
||||||
|
|
||||||
- name: Add Paperclip public key to Mastodon config
|
- name: Add Paperclip public key to Mastodon config
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -175,7 +179,7 @@
|
||||||
line: "{{ vapid_public_key }}"
|
line: "{{ vapid_public_key }}"
|
||||||
regexp: "^VAPID_PUBLIC_KEY="
|
regexp: "^VAPID_PUBLIC_KEY="
|
||||||
mode: 0600
|
mode: 0600
|
||||||
backup: yes
|
backup: true
|
||||||
|
|
||||||
- name: Build Mastodon container to include secrets
|
- name: Build Mastodon container to include secrets
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
|
@ -240,36 +244,43 @@
|
||||||
template:
|
template:
|
||||||
src: templates/mastodon.service.j2
|
src: templates/mastodon.service.j2
|
||||||
dest: /etc/systemd/system/mastodon.service
|
dest: /etc/systemd/system/mastodon.service
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Deploy Mastodon Media Remove systemd service unit
|
- name: Deploy Mastodon Media Remove systemd service unit
|
||||||
template:
|
template:
|
||||||
src: templates/mastodon-media-remove.service.j2
|
src: templates/mastodon-media-remove.service.j2
|
||||||
dest: /etc/systemd/system/mastodon-media-remove.service
|
dest: /etc/systemd/system/mastodon-media-remove.service
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Deploy Mastodon Media Remove systemd timer unit
|
- name: Deploy Mastodon Media Remove systemd timer unit
|
||||||
template:
|
template:
|
||||||
src: templates/mastodon-media-remove.timer.j2
|
src: templates/mastodon-media-remove.timer.j2
|
||||||
dest: /etc/systemd/system/mastodon-media-remove.timer
|
dest: /etc/systemd/system/mastodon-media-remove.timer
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Deploy Mastodon Preview Cards Remove systemd service unit
|
- name: Deploy Mastodon Preview Cards Remove systemd service unit
|
||||||
template:
|
template:
|
||||||
src: templates/mastodon-preview_cards-remove.service.j2
|
src: templates/mastodon-preview_cards-remove.service.j2
|
||||||
dest: /etc/systemd/system/mastodon-preview_cards-remove.service
|
dest: /etc/systemd/system/mastodon-preview_cards-remove.service
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Deploy Mastodon Preview Cards Remove systemd timer unit
|
- name: Deploy Mastodon Preview Cards Remove systemd timer unit
|
||||||
template:
|
template:
|
||||||
src: templates/mastodon-preview_cards-remove.timer.j2
|
src: templates/mastodon-preview_cards-remove.timer.j2
|
||||||
dest: /etc/systemd/system/mastodon-preview_cards-remove.timer
|
dest: /etc/systemd/system/mastodon-preview_cards-remove.timer
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Deploy Mastodon Search Deploy systemd service unit
|
- name: Deploy Mastodon Search Deploy systemd service unit
|
||||||
template:
|
template:
|
||||||
src: templates/mastodon-search-deploy.service.j2
|
src: templates/mastodon-search-deploy.service.j2
|
||||||
dest: /etc/systemd/system/mastodon-search-deploy.service
|
dest: /etc/systemd/system/mastodon-search-deploy.service
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Deploy Mastodon Search Deploy systemd timer unit
|
- name: Deploy Mastodon Search Deploy systemd timer unit
|
||||||
template:
|
template:
|
||||||
src: templates/mastodon-search-deploy.timer.j2
|
src: templates/mastodon-search-deploy.timer.j2
|
||||||
dest: /etc/systemd/system/mastodon-search-deploy.timer
|
dest: /etc/systemd/system/mastodon-search-deploy.timer
|
||||||
|
backup: true
|
||||||
|
|
||||||
- name: Enable Mastodon Media Remove systemd timer unit
|
- name: Enable Mastodon Media Remove systemd timer unit
|
||||||
systemd:
|
systemd:
|
||||||
|
|
Loading…
Reference in a new issue