Fix ansible issues
This commit is contained in:
parent
0bbfe1acec
commit
d92de81c56
4 changed files with 9 additions and 7 deletions
|
@ -22,6 +22,7 @@ forgejo_runner_compose:
|
||||||
docker-in-docker:
|
docker-in-docker:
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
privileged: true
|
privileged: true
|
||||||
|
restart: always
|
||||||
command: dockerd -H tcp://0.0.0.0:2375 --tls=false
|
command: dockerd -H tcp://0.0.0.0:2375 --tls=false
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
- name: Backup unused services
|
- name: Backup unused services
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: sudo autorestic -c .autorestic.all.yml backup -l {{ item }}
|
cmd: sudo autorestic -c .autorestic.all.yml backup -l {{ item.name }}
|
||||||
chdir: "{{ (services_path, 'backup') | path_join }}"
|
chdir: "{{ (services_path, 'backup') | path_join }}"
|
||||||
loop: "{{ unused_services_backups }}"
|
loop: "{{ unused_services_backups }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
- name: Restore volumes
|
- name: Restore volumes
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: tasks/steps/restore-volume.yml
|
file: tasks/steps/restore-volume.yml
|
||||||
loop: "{{ all_services | service_get_backups(role_name) | map(attribute='name') }}"
|
loop: "{{ all_services | service_get_backups(role_name) }}"
|
||||||
|
when: volume.type == 'docker'
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: volume_name
|
loop_var: volume
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
- name: Get infos on volume "{{ volume_name }}"
|
- name: Get infos on volume "{{ volume.name }}"
|
||||||
community.docker.docker_volume_info:
|
community.docker.docker_volume_info:
|
||||||
name: "{{ volume_name }}"
|
name: "{{ volume.name }}"
|
||||||
register: volume_info_result
|
register: volume_info_result
|
||||||
|
|
||||||
- name: Restore volume "{{ volume_name }}"
|
- name: Restore volume "{{ volume.name }}"
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: sudo autorestic -c .autorestic.all.yml restore -l {{ volume_name }}
|
cmd: sudo autorestic -c .autorestic.all.yml restore -l {{ volume.name }} --from borgbase
|
||||||
chdir: "{{ (services_path, 'backup') | path_join }}"
|
chdir: "{{ (services_path, 'backup') | path_join }}"
|
||||||
when: not volume_info_result.exists
|
when: not volume_info_result.exists
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
Loading…
Reference in a new issue