Ask for path of gitea dump to push

This commit is contained in:
flyingscorpio@clevo 2022-12-23 22:17:54 +01:00
parent 1d84b0dd90
commit da9bfe0d00

View file

@ -159,21 +159,27 @@
ansible.builtin.set_fact:
today: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}"
- name: Ask if we push latest gitea_dump zipfile
ansible.builtin.pause: # today's gitea dump zipfile must be in the manager's /tmp
prompt: Push latest gitea dump? [yes/no]
- name: Ask to push latest gitea_dump zipfile
ansible.builtin.pause:
prompt: "Local path to latest gitea dump, so we can push it [leave empty to not push]"
echo: true
register: push_latest_gitea_dump
register: latest_gitea_dump_path
- name: Make sure the filename makes sense
ansible.builtin.assert:
that:
- "{{ latest_gitea_dump_path.user_input | basename }} == gitea-dump-{{ today }}.zip"
when: latest_gitea_dump_path.user_input != ''
- name: Push latest gitea_dump zipfile
become: true
ansible.builtin.copy:
src: "/tmp/gitea-dump-{{ today }}.zip"
src: "{{ latest_gitea_dump_path.user_input }}"
dest: "/home/git/gitea-dumps/gitea-dump-{{ today }}.zip"
owner: git
group: git
mode: 0640
when: push_latest_gitea_dump.user_input == 'yes'
when: latest_gitea_dump_path.user_input != ''
- name: Deploy repos
become: true