fix: remove recommended packages by default
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2022-03-09 22:30:12 +01:00
parent a9f5b73d5a
commit 5843c82fe7
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 27 additions and 15 deletions

View File

@ -24,9 +24,15 @@ packages_deltarpm_percentage: 75
packages_upgrade_enabled: False packages_upgrade_enabled: False
packages_packages_enablerepo: [] packages_enablerepo: []
packages_install: [] packages_install: []
packages_install_extra: [] packages_install_extra: []
packages_uninstall: [] packages_uninstall:
- setroubleshoot
- mcstransd
- xinetd
- ypbind
- telnet
packages_uninstall_extra: []

View File

@ -1,7 +1,13 @@
import os import os
import pytest
import testinfra.utils.ansible_runner import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"] os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all") ).get_hosts("all")
@pytest.mark.parametrize("package", ["setroubleshoot", "mcstransd", "xinetd", "ypbind", "telnet"])
def test_packages_uninstalled(host, package):
assert not host.package(package).is_installed

View File

@ -1,6 +1,14 @@
--- ---
- block: - block:
- name: Add common package repositories - name: Remove repositories
file:
name: "/etc/packages.repos.d/{{ item }}"
state: absent
loop: "{{ packages_repofiles_remove }}"
loop_control:
label: "/etc/packages.repos.d/{{ item }}"
- name: Add common repositories
yum_repository: yum_repository:
name: "{{ item.name }}" name: "{{ item.name }}"
file: "{{ item.filename }}" file: "{{ item.filename }}"
@ -16,25 +24,17 @@
label: "{{ item.name }}" label: "{{ item.name }}"
notify: __packages_upgrade notify: __packages_upgrade
- name: Remove repo files - name: Uninstall packages
file:
name: "/etc/packages.repos.d/{{ item }}"
state: absent
loop: "{{ packages_repofiles_remove }}"
loop_control:
label: "/etc/packages.repos.d/{{ item }}"
- name: Uninstall common packages
package: package:
name: "{{ item }}" name: "{{ item }}"
enablerepo: "{{ packages_packages_enablerepo }}" enablerepo: "{{ packages_enablerepo }}"
state: absent state: absent
loop: "{{ packages_uninstall }}" loop: "{{ packages_uninstall + packages_uninstall_extra }}"
- name: Install common packages - name: Install common packages
package: package:
name: "{{ item }}" name: "{{ item }}"
enablerepo: "{{ packages_packages_enablerepo }}" enablerepo: "{{ packages_enablerepo }}"
state: present state: present
loop: "{{ packages_install + packages_install_extra }}" loop: "{{ packages_install + packages_install_extra }}"
become: True become: True