是否有任何脚本可以清理/var/openebs中的文件



我试着查看GitHub的文档和代码,包括ee ansible脚本是否已经制作了清理/var/openebs中文件的脚本?我的意思是删除的PV类似于:kubectl get-pv--no headers-o custom columns=:metadata.name然后删除包的其余

查看这些信息,您似乎正在运行0.7.2版本以下的代码。0.7.2以上的OpenEBS版本代码处理一个作业,该作业将在节点上调度以清除数据。然而,如果你想在旧版本中使用cleanup,请从OpenEBS社区用户那里获得此代码,他们有下面的示例代码

- hosts: localhost
tasks:
- name: Get list of volumes
shell: kubectl get pv --no-headers -o custom-columns=:metadata.name
args:
executable: /bin/bash
check_mode: no
register: volume_list
- debug: var=volume_list
- hosts: all
tasks:
- name: get files in path
find:
path: /var/openebs
recurse: no
file_type: directory
patterns: 'pvc-*'
register: path_files
- name: Delete volumes
file:
path={{ item.path }}
state=absent
with_items: " {{ path_files.files }} "
when: item.path | basename not in hostvars['localhost']['volume_list']['stdout_lines']

最新更新