---
- name: jspd tpcc delete
  kubernetes.core.helm:
    chart_ref: "/root/jspd-tpcc"
    name: jspd-tpcc
    namespace: default
    state: absent
    wait: true
  when:
    - inventory_hostname == groups['agent-master'][0]

- name: jspd client delete
  kubernetes.core.helm:
    chart_ref: "/root/jspd-client"
    name: jspd-client
    namespace: "{{ NAMESAPCE }}"
    state: absent
    wait: true
  when:
    - inventory_hostname == groups['agent-master'][0]

- name: old jspd-client directory delete
  ignore_errors: true
  file:
    path: /root/jspd-client
    state: absent
  when:
    - delete_enabled
    - inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']

- name: old jspd-tpcc directory delete
  ignore_errors: true
  file:
    path: /root/jspd-tpcc
    state: absent
  when:
    - delete_enabled
    - inventory_hostname in groups['docker'] or inventory_hostname in groups['containerd'] or inventory_hostname in groups['crio']