More ansible-lint fixes
This commit is contained in:
@ -14,7 +14,7 @@ matrix_backup_borg_docker_src_files_path: "{{ matrix_backup_borg_base_path }}/do
|
||||
matrix_backup_borg_version: ""
|
||||
matrix_backup_borg_docker_image: "{{ matrix_backup_borg_docker_image_name_prefix }}etke.cc/borgmatic:{{ matrix_backup_borg_version }}"
|
||||
matrix_backup_borg_docker_image_name_prefix: "{{ 'localhost/' if matrix_backup_borg_container_image_self_build else 'registry.gitlab.com/' }}"
|
||||
matrix_backup_borg_docker_image_force_pull: "{{ matrix_backup_borg_docker_image.endswith(':latest') or matrix_backup_borg_version|default('') == '' }}"
|
||||
matrix_backup_borg_docker_image_force_pull: "{{ matrix_backup_borg_docker_image.endswith(':latest') or matrix_backup_borg_version | default('') == '' }}"
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_backup_borg_container_extra_arguments: []
|
||||
@ -93,8 +93,8 @@ matrix_backup_borg_configuration_extension_yaml: |
|
||||
# If you need something more special, you can take full control by
|
||||
# completely redefining `matrix_backup_borg_configuration_yaml`.
|
||||
|
||||
matrix_backup_borg_configuration_extension: "{{ matrix_backup_borg_configuration_extension_yaml|from_yaml if matrix_backup_borg_configuration_extension_yaml|from_yaml is mapping else {} }}"
|
||||
matrix_backup_borg_configuration_extension: "{{ matrix_backup_borg_configuration_extension_yaml | from_yaml if matrix_backup_borg_configuration_extension_yaml | from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final borgmatic configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_backup_borg_configuration_yaml`.
|
||||
matrix_backup_borg_configuration: "{{ matrix_backup_borg_configuration_yaml|from_yaml|combine(matrix_backup_borg_configuration_extension, recursive=True) }}"
|
||||
matrix_backup_borg_configuration: "{{ matrix_backup_borg_configuration_yaml | from_yaml|combine(matrix_backup_borg_configuration_extension, recursive=True) }}"
|
||||
|
@ -1,4 +1,4 @@
|
||||
---
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-backup-borg.timer'] }}"
|
||||
when: matrix_backup_borg_enabled|bool
|
||||
when: matrix_backup_borg_enabled | bool
|
||||
|
@ -1,23 +1,23 @@
|
||||
---
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_backup_borg_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_backup_borg_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-backup-borg
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_backup_borg_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_backup_borg_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-backup-borg
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_backup_borg_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_backup_borg_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-backup-borg
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- block:
|
||||
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/detect_existing_postgres_version.yml"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/detect_existing_postgres_version.yml"
|
||||
|
||||
- name: Fail if detected Postgres version is unsupported
|
||||
ansible.builtin.fail:
|
||||
@ -10,7 +10,7 @@
|
||||
- name: Set the correct borg backup version to use
|
||||
ansible.builtin.set_fact:
|
||||
matrix_backup_borg_version: "{{ matrix_postgres_detected_version }}"
|
||||
when: matrix_backup_borg_postgresql_enabled|bool and matrix_backup_borg_version == ''
|
||||
when: matrix_backup_borg_postgresql_enabled | bool and matrix_backup_borg_version == ''
|
||||
|
||||
- name: Ensure borg paths exist
|
||||
ansible.builtin.file:
|
||||
@ -22,11 +22,11 @@
|
||||
with_items:
|
||||
- {path: "{{ matrix_backup_borg_config_path }}", when: true}
|
||||
- {path: "{{ matrix_backup_borg_docker_src_files_path }}", when: true}
|
||||
when: "item.when|bool"
|
||||
when: "item.when | bool"
|
||||
|
||||
- name: Ensure borgmatic config is created
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_backup_borg_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
content: "{{ matrix_backup_borg_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_backup_borg_config_path }}/config.yaml"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
@ -54,7 +54,7 @@
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_backup_borg_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_backup_borg_docker_image_force_pull }}"
|
||||
when: "not matrix_backup_borg_container_image_self_build|bool"
|
||||
when: "not matrix_backup_borg_container_image_self_build | bool"
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
@ -68,7 +68,7 @@
|
||||
become: true
|
||||
become_user: "{{ matrix_user_username }}"
|
||||
register: matrix_backup_borg_git_pull_results
|
||||
when: "matrix_backup_borg_container_image_self_build|bool"
|
||||
when: "matrix_backup_borg_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure borg image is built
|
||||
docker_image:
|
||||
@ -80,7 +80,7 @@
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_backup_borg_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_backup_borg_container_image_self_build|bool"
|
||||
when: "matrix_backup_borg_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure matrix-backup-borg.service installed
|
||||
ansible.builtin.template:
|
||||
@ -99,7 +99,7 @@
|
||||
- name: Ensure systemd reloaded after matrix-backup-borg.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_backup_borg_systemd_service_result.changed|bool"
|
||||
when: "matrix_backup_borg_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-backup-borg.service enabled
|
||||
ansible.builtin.service:
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Check existence of matrix-backup-borg service
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-backup-borg.service"
|
||||
register: matrix_backup_borg_service_stat
|
||||
|
||||
@ -11,24 +11,24 @@
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_backup_borg_service_stat.stat.exists|bool"
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure matrix-backup-borg.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-backup-borg.service"
|
||||
state: absent
|
||||
when: "matrix_backup_borg_service_stat.stat.exists|bool"
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure matrix-backup-borg.timer doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-backup-borg.timer"
|
||||
state: absent
|
||||
when: "matrix_backup_borg_service_stat.stat.exists|bool"
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-backup-borg.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_backup_borg_service_stat.stat.exists|bool"
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix borg paths don't exist
|
||||
ansible.builtin.file:
|
||||
|
Reference in New Issue
Block a user