- name: Run lvs
  ansible.builtin.command: "lvs --select 'lv_name = {{ item.lv_name }}' --reportformat json"
  register: snapshot_revert_lvs_response
  changed_when: false

- name: Parse report
  ansible.builtin.set_fact:
    snapshot_revert_lv_attr: "{{ (snapshot_revert_lvs_response.stdout | from_json).report[0].lv[0].lv_attr }}"

- name: Verify that the snapshot is active
  ansible.builtin.assert:
    that:
    - snapshot_revert_lv_attr[0] == 's'
    - snapshot_revert_lv_attr[4] == 'a'
