diff --git a/backup.yml b/backup.yml index 77f5a3b..cb6a866 100644 --- a/backup.yml +++ b/backup.yml @@ -179,72 +179,72 @@ # #! GITEA # ############ -# - ansible.builtin.pip: -# name: requests + - ansible.builtin.pip: + name: requests -# - ansible.builtin.file: -# path: "{{ dockerapps_path }}/backup/gitea" -# state: directory + - ansible.builtin.file: + path: "{{ dockerapps_path }}/backup/gitea" + state: directory -# # mode: '0755' -# #/opt/dockerapps/appdata/gitea/gitea/gitea-dump-*.zip -# - name: DUMP gitea conf -# community.docker.docker_container_exec: -# container: gitea -# command: gitea dump -c /data/gitea/conf/app.ini -# user: git -# chdir: /data + # mode: '0755' +#/opt/dockerapps/appdata/gitea/gitea/gitea-dump-*.zip + - name: DUMP gitea conf + community.docker.docker_container_exec: + container: gitea + command: gitea dump -c /data/gitea/conf/app.ini + user: git + chdir: /data -# - ansible.builtin.find: -# paths: "{{ dockerapps_path }}{{ gitea_conf }}" -# patterns: 'gitea-dump-*.zip' -# register: result_gitea_conf + - ansible.builtin.find: + paths: "{{ dockerapps_path }}{{ gitea_conf }}" + patterns: 'gitea-dump-*.zip' + register: result_gitea_conf -# - name: Print stdout -# ansible.builtin.debug: -# var: result_gitea_conf + - name: Print stdout + ansible.builtin.debug: + var: result_gitea_conf -# - name: Copy file with owner and permissions -# ansible.builtin.copy: -# src: "{{ item.path }}" -# dest: "{{ dockerapps_path }}/backup/gitea/{{ item.path.split('/')[-1]}}" -# remote_src: true -# loop: "{{ result_gitea_conf.files }}" -# # owner: foo -# # group: foo -# # mode: '0644' -# - name: Remove old gitea-dump -# ansible.builtin.file: -# path: "{{ item.path }}" -# state: absent -# loop: "{{ result_gitea_conf.files }}" + - name: Copy file with owner and permissions + ansible.builtin.copy: + src: "{{ item.path }}" + dest: "{{ dockerapps_path }}/backup/gitea/{{ item.path.split('/')[-1]}}" + remote_src: true + loop: "{{ result_gitea_conf.files }}" + # owner: foo + # group: foo + # mode: '0644' + - name: Remove old gitea-dump + ansible.builtin.file: + path: "{{ item.path }}" + state: absent + loop: "{{ result_gitea_conf.files }}" -# #! need root -# # root@scaleway:/opt/dockerapps/appdata/gitea/gitea-db/gitea-db-pg.sql +#! need root +# root@scaleway:/opt/dockerapps/appdata/gitea/gitea-db/gitea-db-pg.sql -# - name: PG_DUMP postgresql db -# community.docker.docker_container_exec: -# container: gitea-db -# command: pg_dump -U root gitea -f /var/lib/postgresql/data/gitea-db-pg.sql -# # chdir: "{{ dockerapps_path }}" -# register: result_gitea_db + - name: PG_DUMP postgresql db + community.docker.docker_container_exec: + container: gitea-db + command: pg_dump -U root gitea -f /var/lib/postgresql/data/gitea-db-pg.sql + # chdir: "{{ dockerapps_path }}" + register: result_gitea_db -# # - ansible.builtin.debug: -# # var: result_gitea_db.stdout + # - ansible.builtin.debug: + # var: result_gitea_db.stdout -# - name: Copy file with owner and permissions -# become: true -# ansible.builtin.copy: -# src: "{{ dockerapps_path }}{{ gitea_db }}" -# dest: "{{ dockerapps_path }}/backup/gitea/{{ gitea_db.split('/')[-1] }}" -# remote_src: true + - name: Copy file with owner and permissions + become: true + ansible.builtin.copy: + src: "{{ dockerapps_path }}{{ gitea_db }}" + dest: "{{ dockerapps_path }}/backup/gitea/{{ gitea_db.split('/')[-1] }}" + remote_src: true -# - ansible.builtin.file: -# path: "{{ dockerapps_path }}/backup" -# state: directory -# mode: 0755 -# recurse: true -# become: true + - ansible.builtin.file: + path: "{{ dockerapps_path }}/backup" + state: directory + mode: 0755 + recurse: true + become: true - name: logout bw