--- - name: Delete object file ({{tmpfile.path}}) ansible.builtin.file: path=/etc/openshift_apps/{{object_delete_app}}/{{object_delete_objectname}}.yml state=absent when: object_delete_objecttype != 'project' - name: Delete project files ({{tmpfile.path}}) ansible.builtin.file: path=/etc/openshift_apps/{{object_delete_app}} state=absent when: object_delete_objecttype == 'project' - name: Call `oc delete` on the object ansible.builtin.shell: oc -n {{object_delete_app}} delete {{object_delete_objecttype}}/{{object_delete_objectname}}