diff --git a/README.md b/README.md index 7131b3d..199e0d6 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/defaults/main.yml b/defaults/main.yml index c45e67b..3e96b1e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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. # diff --git a/tasks/backup.yml b/tasks/backup.yml index c3bb0ef..0405852 100644 --- a/tasks/backup.yml +++ b/tasks/backup.yml @@ -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 @@ -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 @@ -58,3 +60,4 @@ msg: '{{ rentention_result.stdout }}' when: - rentention_result is defined +... diff --git a/tasks/backup_init.yml b/tasks/backup_init.yml index ea219ab..f860a5a 100644 --- a/tasks/backup_init.yml +++ b/tasks/backup_init.yml @@ -83,4 +83,5 @@ - restic_seeded is defined - restic_seeded.changed is defined - restic_seeded.changed - - restic_seeded.delta is defined \ No newline at end of file + - restic_seeded.delta is defined +... diff --git a/tasks/backup_list.yml b/tasks/backup_list.yml index 017e6ec..72d9d58 100644 --- a/tasks/backup_list.yml +++ b/tasks/backup_list.yml @@ -10,4 +10,4 @@ - name: backup_list debug ansible.builtin.debug: msg: "{{ backup_list_result.stdout }}" - \ No newline at end of file +... diff --git a/tasks/main.yml b/tasks/main.yml index d32feff..6d211c7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -73,3 +73,4 @@ - docker-container-backup-list-stirlingpdf when: - docker_container_stirlingpdf_restic_enable +... diff --git a/tasks/prereq.yml b/tasks/prereq.yml index 91b5aac..d54ed2f 100644 --- a/tasks/prereq.yml +++ b/tasks/prereq.yml @@ -1,4 +1,5 @@ --- - name: Install docker python sdk ansible.builtin.pip: - name: docker \ No newline at end of file + name: docker +... diff --git a/tasks/purge.yml b/tasks/purge.yml index 0332574..f693956 100644 --- a/tasks/purge.yml +++ b/tasks/purge.yml @@ -4,3 +4,4 @@ path: "{{ docker_container_stirlingpdf_volume_dir }}" state: absent when: docker_container_stirlingpdf_volume_dir is defined +... diff --git a/tasks/remove.yml b/tasks/remove.yml index 9afaafd..d9f8b63 100644 --- a/tasks/remove.yml +++ b/tasks/remove.yml @@ -11,3 +11,4 @@ name: "{{ docker_network_stirlingpdf_name }}" force: yes state: absent +... diff --git a/tasks/restore.yml b/tasks/restore.yml index 92f96c1..78871f1 100644 --- a/tasks/restore.yml +++ b/tasks/restore.yml @@ -36,4 +36,5 @@ state: started when: - docker_container_info_result.exists - - docker_container_info_result.container.State.Running \ No newline at end of file + - docker_container_info_result.container.State.Running +...