--- - name: Timeshift operations hosts: all become: true gather_facts: false tasks: - name: List Timeshift snapshots ansible.builtin.command: timeshift --list register: timeshift_list_result when: timeshift_action == "list" changed_when: false - name: Display snapshots ansible.builtin.debug: msg: "{{ timeshift_list_result.stdout_lines }}" when: timeshift_action == "list" - name: Restore from snapshot ansible.builtin.command: timeshift --restore --snapshot "{{ timeshift_snapshot }}" --scripted # noqa command-instead-of-module when: timeshift_action == "restore" register: timeshift_restore_result changed_when: false - name: Display restore result ansible.builtin.debug: msg: "{{ timeshift_restore_result.stdout_lines }}" when: timeshift_action == "restore"