---
- name: Remove OOTB exchange_plugin
  block:
    - name: Remove exchange_plugin data loader
      ansible.builtin.file:
        path: "/opt/squirro/packaged_dataloader_plugins/exchange_plugin"
        state: absent
    - name: Remove exchange_plugin assets
      ansible.builtin.shell: |
        find /var/lib/squirro/topic/assets/dataloader_plugin/ \
          -type d -name exchange_plugin -exec rm -rf {} +
      changed_when: true

- name: Remove OOTB packaged extauth_saml
  block:
    - name: Remove extauth_saml studio plugin
      ansible.builtin.file:
        path: "/opt/squirro/packaged_studio_plugins/extauth_saml"
        state: absent
    - name: Remove extauth_saml assets
      ansible.builtin.shell: |
        find /var/lib/squirro/topic/assets/studio_plugin/ \
          -type d -name extauth_saml -exec rm -rf {} +
      changed_when: true
