ansible-role-ansible/tasks/uninstall.yml
2020-04-05 23:29:22 +02:00

30 lines
866 B
YAML

---
- name: Define repo for {{ ansible_os_family }}
include_tasks: add_repo_{{ ansible_os_family }}.yml
- name: Remove Ansible's files
file:
path: "/etc/yum.repos.d/ansible.repo"
state: absent
when:
- ansible_os_family == 'RedHat'
- name: Registering Ubuntu Ansible repository
apt_repository:
repo: ppa:ansible/ansible
state: absent
update_cache: yes
when:
- ansible_distribution == "Ubuntu"
- name: Registering Debian Ansible repository
apt_repository:
repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main
filename: ansible.list
state: absent
update_cache: yes
when:
- ansible_distribution == "Debian"
- name: Remove Ansible's packages
package: name='{{ ansible_packages }}' state=absent update_cache=yes