diff --git a/roles/discourse/tasks/main.yml b/roles/discourse/tasks/main.yml index d334b1ad641e109de771f6cb9c7a555ff13ee0e7..e66a0054c3d6278ca3ff09eda207cd7fad59eea9 100644 --- a/roles/discourse/tasks/main.yml +++ b/roles/discourse/tasks/main.yml @@ -17,6 +17,20 @@ groups: discourse,docker uid: 1000 +- name: Stat /var/discourse/lost+found + stat: + path: "/var/discourse/lost+found" + register: var_discourse_partition + +- block: + + - name: Delete lost+found directory if /var/discourse is a partition + file: + dest: /var/discourse/lost+found + state: absent + + when: var_discourse_partition.stat.exists == True + - name: Directory for Discourse present file: dest: /var/discourse @@ -86,6 +100,16 @@ become: yes become_user: 'discourse' +- block: + + - name: Create lost+found directory + command: mklost+found + args: + chdir: /var/discourse + creates: /var/discourse/lost+found + + when: var_discourse_partition.stat.exists == True + - name: Count how much swap is available shell: "free -g --si | awk '/^Swap:/{print $2}'" args: