mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2025-05-20 01:15:09 +02:00
Try to find services in ansible_facts
This commit is contained in:
parent
6b88b7c97e
commit
a39e889ba8
@ -41,7 +41,7 @@
|
|||||||
borg_install_method: pip
|
borg_install_method: pip
|
||||||
borg_ssh_key_file: "{{ backup_user_info.home }}/.ssh/backup"
|
borg_ssh_key_file: "{{ backup_user_info.home }}/.ssh/backup"
|
||||||
borg_ssh_command: "ssh -i {{ borg_ssh_key_file }} -o StrictHostKeyChecking=no"
|
borg_ssh_command: "ssh -i {{ borg_ssh_key_file }} -o StrictHostKeyChecking=no"
|
||||||
borgmatic_timer: "systemd"
|
borgmatic_timer: cron
|
||||||
|
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: Install yamllint for checking config file
|
- name: Install yamllint for checking config file
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
# If the role is running and the repo is not yet initialized, an error will occur.
|
# If the role is running and the repo is not yet initialized, an error will occur.
|
||||||
# Therefore the service is stopped by default and must be started manually.
|
# Therefore the service is stopped by default and must be started manually.
|
||||||
- name: Stop fresh installed borgmatic.timer and borgmatic.service
|
- name: Stop fresh installed borgmatic.timer and borgmatic.service
|
||||||
when: ('borgmatic.service' not in services)
|
when: "'borgmatic.service' not in ansible_facts.services"
|
||||||
block:
|
block:
|
||||||
- name: Set borgmatic services to stopped - fresh installed
|
- name: Set borgmatic services to stopped - fresh installed
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
@ -33,7 +33,7 @@
|
|||||||
enabled: false
|
enabled: false
|
||||||
masked: false
|
masked: false
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when: "item in services"
|
when: item in ansible_facts.services
|
||||||
with_items:
|
with_items:
|
||||||
- borgmatic.service
|
- borgmatic.service
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user