Add task to remove unused repos and pkgs
This commit is contained in:
1 parent
834d37ae66
commit
66e258da7e
2 files changed
+20
-2
No files matched your search
@@ -10,4 +10,6 @@
|
||||
- include: securetty.yml
|
||||
- include: suid_sgid.yml
|
||||
- include: sysctl.yml
|
||||
|
||||
- include: yum.yml
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Oracle Linux'
|
||||
@@ -1,8 +1,24 @@
|
||||
---
|
||||
- name: activate gpg-check for yum-repos in yum.conf
|
||||
shell: "sed -i 's/gpgcheck=0/gpgcheck=1/g' /etc/yum.conf"
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Oracle Linux'
|
||||
|
||||
- name: activate gpg-check for yum-repos in yum-repositories
|
||||
shell: "sed -i 's/gpgcheck=0/gpgcheck=1/g' /etc/yum.repos.d/*.repo"
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Oracle Linux'
|
||||
|
||||
- name: remove unused repositories
|
||||
file: name='/etc/yum.repos.d/{{item}}.repo' state=absent
|
||||
with_items:
|
||||
- 'CentOS-Debuginfo'
|
||||
- 'CentOS-Media'
|
||||
- 'CentOS-Vault'
|
||||
when: os_security_packages_clean
|
||||
|
||||
- name: remove packages
|
||||
yum: name='{{item}}' state=removed
|
||||
with_items:
|
||||
- xinetd
|
||||
- inetd
|
||||
- ypserv
|
||||
- telnet-server
|
||||
- rsh-server
|
||||
when: os_security_packages_clean
|
||||
Reference in new issue
Block a user