chore: add base role
This commit is contained in:
17
roles/base/tasks/python_cleanup.yml
Normal file
17
roles/base/tasks/python_cleanup.yml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Find all EXTERNALLY-MANAGED files under /usr/lib/python*
|
||||
find:
|
||||
paths: /usr/lib
|
||||
patterns: "EXTERNALLY-MANAGED"
|
||||
file_type: file
|
||||
recurse: yes
|
||||
register: externally_managed_files
|
||||
become: yes
|
||||
|
||||
- name: Delete EXTERNALLY-MANAGED files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
loop: "{{ externally_managed_files.files }}"
|
||||
when: externally_managed_files.matched > 0
|
||||
become: yes
|
Reference in New Issue
Block a user