1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

remove prealloc.* in the Ansible way (works even if files absent)

This commit is contained in:
A Holt 2017-10-18 19:08:30 -04:00 committed by GitHub
parent eb2550141b
commit 48b30cc8a7

View file

@ -45,10 +45,19 @@
- { name: mongodb } - { name: mongodb }
when: not mongodb_enabled when: not mongodb_enabled
# See https://github.com/iiab/iiab/issues/254 for other attempts to eliminate these 256MB files # See https://github.com/iiab/iiab/issues/254 for other attempts to eliminate
- name: remove journal prealloc files # these 256MB files. Brute Force Idea: rm /var/lib/mongodb/journal/prealloc.*
shell: rm /var/lib/mongodb/journal/prealloc.* - name: find /var/lib/mongodb/prealloc.* files to delete
when: not mongodb_enabled find:
paths: /var/lib/mongodb/journal
patterns: prealloc.*
register: files_to_delete
- name: delete prealloc files
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ files_to_delete.files }}"
- name: add mongodb to service list - name: add mongodb to service list
ini_file: dest='{{ service_filelist }}' ini_file: dest='{{ service_filelist }}'