borgmatic: check mode fixes
This commit is contained in:
@@ -12,12 +12,14 @@
|
|||||||
- name: Install borgmatic
|
- name: Install borgmatic
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: borgmatic
|
name: borgmatic
|
||||||
|
register: _borgmatic_install
|
||||||
|
|
||||||
- name: Disable borgmatic global timer
|
- name: Disable borgmatic global timer
|
||||||
ansible.builtin.systemd_service:
|
ansible.builtin.systemd_service:
|
||||||
name: borgmatic.timer
|
name: borgmatic.timer
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: false
|
enabled: false
|
||||||
|
when: "not (ansible_check_mode and _borgmatic_install.changed)"
|
||||||
|
|
||||||
- name: Add systemd drop-in service for borgmatic
|
- name: Add systemd drop-in service for borgmatic
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Gather facts
|
- name: Gather facts
|
||||||
ansible.builtin.setup:
|
ansible.builtin.setup:
|
||||||
delegate_facts: true
|
delegate_facts: true
|
||||||
|
retries: 3
|
||||||
|
|
||||||
- name: Add ssh key to authorized_keys
|
- name: Add ssh key to authorized_keys
|
||||||
ansible.posix.authorized_key:
|
ansible.posix.authorized_key:
|
||||||
|
|||||||
@@ -4,3 +4,4 @@
|
|||||||
name: "borgmatic@{{ borgmatic_config_name }}.timer"
|
name: "borgmatic@{{ borgmatic_config_name }}.timer"
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
ignore_errors: "{{ ansible_check_mode }}"
|
||||||
|
|||||||
@@ -32,4 +32,4 @@
|
|||||||
name: borgmatic@{{ borgmatic_config_name }}.timer
|
name: borgmatic@{{ borgmatic_config_name }}.timer
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
when: "not (ansible_check_mode and _borgmatic_config_systemd_timer.changed and _borgmatic_config_systemd_timer.diff.before == '')"
|
when: "not (ansible_check_mode and _borgmatic_config_systemd_timer.changed)"
|
||||||
|
|||||||
Reference in New Issue
Block a user