# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Note: We install the yum package onto Fedora so that this will work on dnf systems
# Note: We install the yum package onto Fedora so that this will work on dnf systems
# We want to test that for people who don't want to upgrade their systems.
# We want to test that for people who don't want to upgrade their systems.
- block:
- block:
- include:'yum.yml'
- import_tasks:yum.yml
always:
always:
- name:remove installed packages
- name:remove installed packages
yum:
yum:
@ -29,49 +15,48 @@
- sos
- sos
state:absent
state:absent
# On CentOS 6 'yum groupremove "Development Tools"' fails when groupremove_leaf_only
# isn't enabled, that's why a package belonging to "Development Tools" (autoconf)
# is removed instead of the whole group.
- name:remove installed group
- name:remove installed group
yum:
yum:
name:"@Development tools"
name:"@Custom Group"
state:absent
state:absent
when:
- (ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and ansible_distribution_major_version|int > 6) or ansible_distribution in ['Fedora']
- name:OnFedora 28 the above won't remove the group which results in a failure in repo.yml below
- name:remove a package from a group
yum:
yum:
name:'autoconf'
name:foo
state:absent
state:absent
when:
when:
- ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and ansible_distribution_major_version|int <= 6
- ansible_distribution in ['Fedora']
when:
when:
- ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux', 'Fedora']
- ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux', 'Fedora']