---
# tasks to uninstall IPA client
- name: Uninstall - Uninstall IPA client
command: >
/usr/sbin/ipa-client-install
--uninstall
-U
register: uninstall
# 2 means that uninstall failed because IPA client was not configured
failed_when: uninstall.rc != 0 and uninstall.rc != 2
changed_when: uninstall.rc == 0
#- name: Remove IPA client package
# package:
# name: "{{ ipaclient_packages }}"
# state: absent