ansible-role-ossec/tasks/uninstall.yml
2020-04-16 14:12:00 +02:00

44 lines
1.2 KiB
YAML

---
- name: Remove OSSEC server packages
package:
name: '{{ ossec_server_packages }}'
state: absent
update_cache: yes
when:
- ossec_server == true
- name: Remove OSSEC client packages
package:
name: '{{ ossec_client_packages }}'
state: absent
update_cache: yes
when:
- ossec_client == true
- name: Remove yum repository definition
file:
path: "{{ item }}"
state: absent
with_items:
- "/etc/yum.repos.d/atomic.repo"
- "/etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt"
when:
- ansible_os_family == 'RedHat'
- name: Remove Ubuntu Atomic repository
apt_repository:
repo: deb https://updates.atomicorp.com/channels/atomic/ubuntu {{ ansible_distribution_name }}
filename: atomic.list
state: absent
update_cache: yes
when:
- ansible_distribution == "Ubuntu"
- name: Remove Debian Atomic repository
apt_repository:
repo: deb https://updates.atomicorp.com/channels/atomic/debian {{ ansible_distribution_name }}
filename: atomic.list
state: absent
update_cache: yes
when:
- ansible_distribution == "Debian"