[last try from k0sctl, migration to github]
This commit is contained in:
120
backup.yml
120
backup.yml
@@ -179,75 +179,75 @@
|
|||||||
# #! GITEA
|
# #! GITEA
|
||||||
# ############
|
# ############
|
||||||
|
|
||||||
- ansible.builtin.pip:
|
# - ansible.builtin.pip:
|
||||||
name: requests
|
# name: requests
|
||||||
|
|
||||||
- ansible.builtin.file:
|
# - ansible.builtin.file:
|
||||||
path: "{{ dockerapps_path }}/backup/gitea"
|
# path: "{{ dockerapps_path }}/backup/gitea"
|
||||||
state: directory
|
# state: directory
|
||||||
|
|
||||||
# mode: '0755'
|
# # mode: '0755'
|
||||||
#/opt/dockerapps/appdata/gitea/gitea/gitea-dump-*.zip
|
# #/opt/dockerapps/appdata/gitea/gitea/gitea-dump-*.zip
|
||||||
- name: DUMP gitea conf
|
# - name: DUMP gitea conf
|
||||||
community.docker.docker_container_exec:
|
# community.docker.docker_container_exec:
|
||||||
container: gitea
|
# container: gitea
|
||||||
command: gitea dump -c /data/gitea/conf/app.ini
|
# command: gitea dump -c /data/gitea/conf/app.ini
|
||||||
user: git
|
# user: git
|
||||||
chdir: /data
|
# chdir: /data
|
||||||
|
|
||||||
- ansible.builtin.find:
|
# - ansible.builtin.find:
|
||||||
paths: "{{ dockerapps_path }}{{ gitea_conf }}"
|
# paths: "{{ dockerapps_path }}{{ gitea_conf }}"
|
||||||
patterns: 'gitea-dump-*.zip'
|
# patterns: 'gitea-dump-*.zip'
|
||||||
register: result_gitea_conf
|
# register: result_gitea_conf
|
||||||
|
|
||||||
- name: Print stdout
|
# - name: Print stdout
|
||||||
ansible.builtin.debug:
|
# ansible.builtin.debug:
|
||||||
var: result_gitea_conf
|
# var: result_gitea_conf
|
||||||
|
|
||||||
- name: Copy file with owner and permissions
|
# - name: Copy file with owner and permissions
|
||||||
ansible.builtin.copy:
|
# ansible.builtin.copy:
|
||||||
src: "{{ item.path }}"
|
# src: "{{ item.path }}"
|
||||||
dest: "{{ dockerapps_path }}/backup/gitea/{{ item.path.split('/')[-1]}}"
|
# dest: "{{ dockerapps_path }}/backup/gitea/{{ item.path.split('/')[-1]}}"
|
||||||
remote_src: true
|
# remote_src: true
|
||||||
loop: "{{ result_gitea_conf.files }}"
|
# loop: "{{ result_gitea_conf.files }}"
|
||||||
# owner: foo
|
# # owner: foo
|
||||||
# group: foo
|
# # group: foo
|
||||||
# mode: '0644'
|
# # mode: '0644'
|
||||||
- name: Remove old gitea-dump
|
# - name: Remove old gitea-dump
|
||||||
ansible.builtin.file:
|
# ansible.builtin.file:
|
||||||
path: "{{ item.path }}"
|
# path: "{{ item.path }}"
|
||||||
state: absent
|
# state: absent
|
||||||
loop: "{{ result_gitea_conf.files }}"
|
# loop: "{{ result_gitea_conf.files }}"
|
||||||
|
|
||||||
#! need root
|
# #! need root
|
||||||
# root@scaleway:/opt/dockerapps/appdata/gitea/gitea-db/gitea-db-pg.sql
|
# # root@scaleway:/opt/dockerapps/appdata/gitea/gitea-db/gitea-db-pg.sql
|
||||||
|
|
||||||
- name: PG_DUMP postgresql db
|
# - name: PG_DUMP postgresql db
|
||||||
community.docker.docker_container_exec:
|
# community.docker.docker_container_exec:
|
||||||
container: gitea-db
|
# container: gitea-db
|
||||||
command: pg_dump -U root gitea -f /var/lib/postgresql/data/gitea-db-pg.sql
|
# command: pg_dump -U root gitea -f /var/lib/postgresql/data/gitea-db-pg.sql
|
||||||
# chdir: "{{ dockerapps_path }}"
|
# # chdir: "{{ dockerapps_path }}"
|
||||||
register: result_gitea_db
|
# register: result_gitea_db
|
||||||
|
|
||||||
# - ansible.builtin.debug:
|
# # - ansible.builtin.debug:
|
||||||
# var: result_gitea_db.stdout
|
# # var: result_gitea_db.stdout
|
||||||
|
|
||||||
- name: Copy file with owner and permissions
|
# - name: Copy file with owner and permissions
|
||||||
become: true
|
# become: true
|
||||||
ansible.builtin.copy:
|
# ansible.builtin.copy:
|
||||||
src: "{{ dockerapps_path }}{{ gitea_db }}"
|
# src: "{{ dockerapps_path }}{{ gitea_db }}"
|
||||||
dest: "{{ dockerapps_path }}/backup/gitea/{{ gitea_db.split('/')[-1] }}"
|
# dest: "{{ dockerapps_path }}/backup/gitea/{{ gitea_db.split('/')[-1] }}"
|
||||||
remote_src: true
|
# remote_src: true
|
||||||
|
|
||||||
- ansible.builtin.file:
|
# - ansible.builtin.file:
|
||||||
path: "{{ dockerapps_path }}/backup"
|
# path: "{{ dockerapps_path }}/backup"
|
||||||
state: directory
|
# state: directory
|
||||||
mode: 0755
|
# mode: 0755
|
||||||
recurse: true
|
# recurse: true
|
||||||
become: true
|
# become: true
|
||||||
|
|
||||||
|
|
||||||
- name: logout bw
|
# - name: logout bw
|
||||||
ansible.builtin.command:
|
# ansible.builtin.command:
|
||||||
cmd: bw logout
|
# cmd: bw logout
|
||||||
delegate_to: localhost
|
# delegate_to: localhost
|
||||||
Reference in New Issue
Block a user