Skip to content

Commit

Permalink
added docker_container_stirlingpdf_restic_stop_during_backup
Browse files Browse the repository at this point in the history
  • Loading branch information
andif888 committed Nov 26, 2024
1 parent f071e44 commit c19caba
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Role to run stirlingpdf in a docker container
- [docker_container_stirlingpdf_restic_s3_repo_access_key](#docker_container_stirlingpdf_restic_s3_repo_access_key)
- [docker_container_stirlingpdf_restic_s3_repo_password](#docker_container_stirlingpdf_restic_s3_repo_password)
- [docker_container_stirlingpdf_restic_s3_repo_secret_key](#docker_container_stirlingpdf_restic_s3_repo_secret_key)
- [docker_container_stirlingpdf_restic_stop_during_backup](#docker_container_stirlingpdf_restic_stop_during_backup)
- [docker_container_stirlingpdf_restic_tag](#docker_container_stirlingpdf_restic_tag)
- [docker_container_stirlingpdf_volume_dir](#docker_container_stirlingpdf_volume_dir)
- [docker_container_stirlingpdf_volumes](#docker_container_stirlingpdf_volumes)
Expand Down Expand Up @@ -242,6 +243,16 @@ docker_container_stirlingpdf_restic_s3_repo_secret_key: '{{ docker_container__ba
}}'
```

### docker_container_stirlingpdf_restic_stop_during_backup

Stop and restart container during backup operation.

#### Default value

```YAML
docker_container_stirlingpdf_restic_stop_during_backup: false
```

### docker_container_stirlingpdf_restic_tag

Tag for the `restic backup` command
Expand Down
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ docker_network_stirlingpdf_name: "{{ docker_container_stirlingpdf_name }}_backen
# @end
docker_container_stirlingpdf_restic_enable: false

# @var docker_container_stirlingpdf_restic_stop_during_backup:description: >
# Stop and restart container during backup operation.
# @end
docker_container_stirlingpdf_restic_stop_during_backup: false

# @var docker_container_stirlingpdf_restic_s3_endpoint:description: >
# Minio S3 endpoint for restic backup storage.
#
Expand Down
3 changes: 3 additions & 0 deletions tasks/backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
name: "{{ docker_container_stirlingpdf_name }}"
state: stopped
when:
- docker_container_stirlingpdf_restic_stop_during_backup
- docker_container_info_result.exists
- docker_container_info_result.container.State.Running

Expand All @@ -37,6 +38,7 @@
name: "{{ docker_container_stirlingpdf_name }}"
state: started
when:
- docker_container_stirlingpdf_restic_stop_during_backup
- docker_container_info_result.exists
- docker_container_info_result.container.State.Running

Expand All @@ -58,3 +60,4 @@
msg: '{{ rentention_result.stdout }}'
when:
- rentention_result is defined
...
3 changes: 2 additions & 1 deletion tasks/backup_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@
- restic_seeded is defined
- restic_seeded.changed is defined
- restic_seeded.changed
- restic_seeded.delta is defined
- restic_seeded.delta is defined
...
2 changes: 1 addition & 1 deletion tasks/backup_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
- name: backup_list debug
ansible.builtin.debug:
msg: "{{ backup_list_result.stdout }}"
...
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@
- docker-container-backup-list-stirlingpdf
when:
- docker_container_stirlingpdf_restic_enable
...
3 changes: 2 additions & 1 deletion tasks/prereq.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
- name: Install docker python sdk
ansible.builtin.pip:
name: docker
name: docker
...
1 change: 1 addition & 0 deletions tasks/purge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
path: "{{ docker_container_stirlingpdf_volume_dir }}"
state: absent
when: docker_container_stirlingpdf_volume_dir is defined
...
1 change: 1 addition & 0 deletions tasks/remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
name: "{{ docker_network_stirlingpdf_name }}"
force: yes
state: absent
...
3 changes: 2 additions & 1 deletion tasks/restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
state: started
when:
- docker_container_info_result.exists
- docker_container_info_result.container.State.Running
- docker_container_info_result.container.State.Running
...

0 comments on commit c19caba

Please sign in to comment.