fix: remove recommended packages by default
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a9f5b73d5a
commit
5843c82fe7
@ -24,9 +24,15 @@ packages_deltarpm_percentage: 75
|
||||
|
||||
packages_upgrade_enabled: False
|
||||
|
||||
packages_packages_enablerepo: []
|
||||
packages_enablerepo: []
|
||||
|
||||
packages_install: []
|
||||
packages_install_extra: []
|
||||
|
||||
packages_uninstall: []
|
||||
packages_uninstall:
|
||||
- setroubleshoot
|
||||
- mcstransd
|
||||
- xinetd
|
||||
- ypbind
|
||||
- telnet
|
||||
packages_uninstall_extra: []
|
||||
|
@ -1,7 +1,13 @@
|
||||
import os
|
||||
import pytest
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ["MOLECULE_INVENTORY_FILE"]
|
||||
).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
|
||||
|
@ -1,6 +1,14 @@
|
||||
---
|
||||
- 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:
|
||||
name: "{{ item.name }}"
|
||||
file: "{{ item.filename }}"
|
||||
@ -16,25 +24,17 @@
|
||||
label: "{{ item.name }}"
|
||||
notify: __packages_upgrade
|
||||
|
||||
- name: Remove repo files
|
||||
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
|
||||
- name: Uninstall packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
enablerepo: "{{ packages_packages_enablerepo }}"
|
||||
enablerepo: "{{ packages_enablerepo }}"
|
||||
state: absent
|
||||
loop: "{{ packages_uninstall }}"
|
||||
loop: "{{ packages_uninstall + packages_uninstall_extra }}"
|
||||
|
||||
- name: Install common packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
enablerepo: "{{ packages_packages_enablerepo }}"
|
||||
enablerepo: "{{ packages_enablerepo }}"
|
||||
state: present
|
||||
loop: "{{ packages_install + packages_install_extra }}"
|
||||
become: True
|
||||
|
Loading…
Reference in New Issue
Block a user