2023-02-28 01:36:25 +01:00

32 lines
881 B
YAML

---
- name: check
ansible.builtin.command:
cmd: >
{{ routerbackup_bin }}/backup_check --backupdir {{ routerbackup_dir }}
--host {{ inventory_hostname }} --maxage {{ routerbackup_maxage }}
delegate_to: localhost
changed_when: false
failed_when: false
register: check
- name: create empty check file
copy:
content: ""
dest: "{{ routerbackup_checkfile }}"
delegate_to: localhost
run_once: true
changed_when: false
when: "routerbackup_checkfile is defined"
- name: fill check into file
lineinfile:
path: "{{ routerbackup_checkfile }}"
line: "{{ check.stdout }}"
delegate_to: localhost
changed_when: false
when:
- "routerbackup_checkfile is defined"
- "check.stdout != ''"
# vim: set tabstop=2 shiftwidth=2 expandtab smarttab: