mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-15 08:30:46 +02:00
Solved bug which prevented backup2loc to be activated
This commit is contained in:
parent
6d14f16dfd
commit
0b3b3a810a
@ -2,7 +2,7 @@
|
|||||||
application_id: "svc-prx-openresty"
|
application_id: "svc-prx-openresty"
|
||||||
|
|
||||||
# Deactivate Database for openresty
|
# Deactivate Database for openresty
|
||||||
database_enabled: false
|
database_type: ""
|
||||||
|
|
||||||
# Openresty
|
# Openresty
|
||||||
openresty_image: "openresty/openresty"
|
openresty_image: "openresty/openresty"
|
||||||
|
@ -1 +0,0 @@
|
|||||||
database_enabled: "{{ database_type | default('') | bool }}" # Enables the database backup
|
|
@ -1,12 +1,12 @@
|
|||||||
- block:
|
- block:
|
||||||
- name: "pkgmgr install {{ bkp_docker_to_local_pkg }}"
|
- name: "pkgmgr install {{ bkp_docker_2_loc_pkg }}"
|
||||||
include_role:
|
include_role:
|
||||||
name: pkgmgr-install
|
name: pkgmgr-install
|
||||||
vars:
|
vars:
|
||||||
package_name: "{{ bkp_docker_to_local_pkg }}"
|
package_name: "{{ bkp_docker_2_loc_pkg }}"
|
||||||
|
|
||||||
- name: "Retrieve {{ bkp_docker_to_local_pkg }} path from pkgmgr"
|
- name: "Retrieve {{ bkp_docker_2_loc_pkg }} path from pkgmgr"
|
||||||
command: "pkgmgr path {{ bkp_docker_to_local_pkg }}"
|
command: "pkgmgr path {{ bkp_docker_2_loc_pkg }}"
|
||||||
register: pkgmgr_output
|
register: pkgmgr_output
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
@ -16,4 +16,4 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
when: backup_docker_to_local_folder is not defined
|
when: backup_docker_to_local_folder is not defined
|
||||||
vars:
|
vars:
|
||||||
bkp_docker_to_local_pkg: backup-docker-to-local
|
bkp_docker_2_loc_pkg: backup-docker-to-local
|
||||||
|
@ -52,10 +52,10 @@
|
|||||||
database_name is defined and
|
database_name is defined and
|
||||||
database_username is defined and
|
database_username is defined and
|
||||||
database_password is defined) and
|
database_password is defined) and
|
||||||
run_once_bkp_docker_to_local_file_permission is not defined
|
run_once_bkp_docker_2_loc_file_permission is not defined
|
||||||
register: file_permission_result
|
register: file_permission_result
|
||||||
|
|
||||||
- name: run the backup_docker_to_local_file_permission tasks once
|
- name: run the backup_docker_to_local_file_permission tasks once
|
||||||
set_fact:
|
set_fact:
|
||||||
run_once_bkp_docker_to_local_file_permission: true
|
run_once_bkp_docker_2_loc_file_permission: true
|
||||||
when: run_once_bkp_docker_to_local_file_permission is not defined and file_permission_result is defined and file_permission_result.changed
|
when: run_once_bkp_docker_2_loc_file_permission is not defined and file_permission_result is defined and file_permission_result.changed
|
@ -3,9 +3,8 @@
|
|||||||
- include_tasks: utils/run_once.yml
|
- include_tasks: utils/run_once.yml
|
||||||
when:
|
when:
|
||||||
- run_once_sys_bkp_docker_2_loc is not defined
|
- run_once_sys_bkp_docker_2_loc is not defined
|
||||||
- database_enabled | bool
|
|
||||||
|
|
||||||
- name: "include 04_seed-database-to-backup.yml"
|
- name: "include 04_seed-database-to-backup.yml"
|
||||||
include_tasks: 04_seed-database-to-backup.yml
|
include_tasks: 04_seed-database-to-backup.yml
|
||||||
when:
|
when:
|
||||||
- database_enabled | bool
|
- bkp_docker_2_loc_db_enabled | bool
|
||||||
|
@ -5,5 +5,5 @@ OnFailure=sys-alm-compose.infinito@%n.service sys-cln-faild-bkps.infinito.servic
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'sys-bkp-docker-2-loc') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'sys-bkp-docker-2-loc') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
||||||
ExecStart=/bin/sh -c '{{ bkp_docker_to_local_exec }} --everything'
|
ExecStart=/bin/sh -c '{{ bkp_docker_2_loc_exec }} --everything'
|
||||||
ExecStartPost=/bin/sh -c '/bin/systemctl start sys-rpr-docker-soft.infinito.service &'
|
ExecStartPost=/bin/sh -c '/bin/systemctl start sys-rpr-docker-soft.infinito.service &'
|
@ -5,5 +5,5 @@ OnFailure=sys-alm-compose.infinito@%n.service sys-cln-faild-bkps.infinito.servic
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'sys-bkp-docker-2-loc-everything') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'sys-bkp-docker-2-loc-everything') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
||||||
ExecStart=/bin/sh -c '{{ bkp_docker_to_local_exec }}'
|
ExecStart=/bin/sh -c '{{ bkp_docker_2_loc_exec }}'
|
||||||
ExecStartPost=/bin/sh -c '/bin/systemctl start sys-rpr-docker-soft.infinito.service &'
|
ExecStartPost=/bin/sh -c '/bin/systemctl start sys-rpr-docker-soft.infinito.service &'
|
@ -1,43 +1,46 @@
|
|||||||
# Mapping logic for backup-docker-to-local CLI arguments
|
# Mapping logic for backup-docker-to-local CLI arguments
|
||||||
#
|
#
|
||||||
# - bkp_docker_to_local_database_routine: All service names where backup.database_routine is set (for --database-containers)
|
# - bkp_docker_2_loc_database_routine: All service names where backup.database_routine is set (for --database-containers)
|
||||||
# - bkp_docker_to_local_no_stop_required: All images where backup.no_stop_required is set (for --images-no-stop-required)
|
# - bkp_docker_2_loc_no_stop_required: All images where backup.no_stop_required is set (for --images-no-stop-required)
|
||||||
# - bkp_docker_to_local_disabled: All images where backup.disabled is set (for --images-no-backup-required)
|
# - bkp_docker_2_loc_disabled: All images where backup.disabled is set (for --images-no-backup-required)
|
||||||
# CLI-ready variables render these lists as argument strings.
|
# CLI-ready variables render these lists as argument strings.
|
||||||
|
|
||||||
|
# Verify if DB is enabled
|
||||||
|
bkp_docker_2_loc_db_enabled: "{{ database_type | default('') | bool }}"
|
||||||
|
|
||||||
# Gather mapped values as lists
|
# Gather mapped values as lists
|
||||||
bkp_docker_to_local_database_routine: >-
|
bkp_docker_2_loc_database_routine: >-
|
||||||
{{ applications | find_dock_val_by_bkp_entr('database_routine', 'name') | list }}
|
{{ applications | find_dock_val_by_bkp_entr('database_routine', 'name') | list }}
|
||||||
|
|
||||||
bkp_docker_to_local_no_stop_required: >-
|
bkp_docker_2_loc_no_stop_required: >-
|
||||||
{{ applications | find_dock_val_by_bkp_entr('no_stop_required', 'image') | list }}
|
{{ applications | find_dock_val_by_bkp_entr('no_stop_required', 'image') | list }}
|
||||||
|
|
||||||
bkp_docker_to_local_disabled: >-
|
bkp_docker_2_loc_disabled: >-
|
||||||
{{ applications | find_dock_val_by_bkp_entr('disabled', 'image') | list }}
|
{{ applications | find_dock_val_by_bkp_entr('disabled', 'image') | list }}
|
||||||
|
|
||||||
# CLI argument strings (only set if list not empty)
|
# CLI argument strings (only set if list not empty)
|
||||||
bkp_docker_to_local_database_routine_cli: >-
|
bkp_docker_2_loc_database_routine_cli: >-
|
||||||
{% if bkp_docker_to_local_database_routine | length > 0 -%}
|
{% if bkp_docker_2_loc_database_routine | length > 0 -%}
|
||||||
--database-containers {{ bkp_docker_to_local_database_routine | join(' ') }}
|
--database-containers {{ bkp_docker_2_loc_database_routine | join(' ') }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
bkp_docker_to_local_no_stop_required_cli: >-
|
bkp_docker_2_loc_no_stop_required_cli: >-
|
||||||
{% if bkp_docker_to_local_no_stop_required | length > 0 -%}
|
{% if bkp_docker_2_loc_no_stop_required | length > 0 -%}
|
||||||
--images-no-stop-required {{ bkp_docker_to_local_no_stop_required | join(' ') }}
|
--images-no-stop-required {{ bkp_docker_2_loc_no_stop_required | join(' ') }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
bkp_docker_to_local_disabled_cli: >-
|
bkp_docker_2_loc_disabled_cli: >-
|
||||||
{% if bkp_docker_to_local_disabled | length > 0 -%}
|
{% if bkp_docker_2_loc_disabled | length > 0 -%}
|
||||||
--images-no-backup-required {{ bkp_docker_to_local_disabled | join(' ') }}
|
--images-no-backup-required {{ bkp_docker_2_loc_disabled | join(' ') }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# List of CLI args for convenience (e.g. for looping or joining)
|
# List of CLI args for convenience (e.g. for looping or joining)
|
||||||
bkp_docker_to_local_cli_args_list:
|
bkp_docker_2_loc_cli_args_list:
|
||||||
- "{{ bkp_docker_to_local_database_routine_cli }}"
|
- "{{ bkp_docker_2_loc_database_routine_cli }}"
|
||||||
- "{{ bkp_docker_to_local_no_stop_required_cli }}"
|
- "{{ bkp_docker_2_loc_no_stop_required_cli }}"
|
||||||
- "{{ bkp_docker_to_local_disabled_cli }}"
|
- "{{ bkp_docker_2_loc_disabled_cli }}"
|
||||||
|
|
||||||
bkp_docker_to_local_exec: >-
|
bkp_docker_2_loc_exec: >-
|
||||||
/usr/bin/python {{ backup_docker_to_local_folder }}backup-docker-to-local.py
|
/usr/bin/python {{ backup_docker_to_local_folder }}backup-docker-to-local.py
|
||||||
--compose-dir {{ path_docker_compose_instances }}
|
--compose-dir {{ path_docker_compose_instances }}
|
||||||
{{ bkp_docker_to_local_cli_args_list | select('string') | join(' ') }}
|
{{ bkp_docker_2_loc_cli_args_list | select('string') | join(' ') }}
|
Loading…
x
Reference in New Issue
Block a user