---
- name: Uninstall package
  register: powerflex_gateway_uninstall_output
  environment:
    I_AM_SURE: "{{ i_am_sure | int }}"
  ansible.builtin.package:
    name: "{{ item }}"
    state: "absent"
  with_items:
    - EMC-ScaleIO-gateway
  when: ansible_distribution in ("RedHat", "CentOS", "SLES")

- name: Uninstall deb package
  register: powerflex_gateway_uninstall_deb_output
  ansible.builtin.apt:
    name: "{{ item }}"
    state: absent
  with_items:
    - emc-scaleio-gateway
  when: ansible_distribution == "Ubuntu"
