diff --git a/tasks/configure.yml b/tasks/configure.yml index 76998dd..790e8b1 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,5 +1,10 @@ --- +- name: '[CONFIG] - Check if files dir exist' + stat: + path: '{{ lufi_upload_dir }}' + register: 'lufi_upload_dir_check' + - name: '[CONFIG] - Create files dir' file: path: '{{ lufi_upload_dir }}' @@ -7,6 +12,7 @@ owner: '{{ lufi_username }}' group: '{{ lufi_group }}' mode: '0700' + when: 'not lufi_upload_dir_check.exists' - name: '[CONFIG] - Deploy lufi config' template: diff --git a/tasks/installapp.yml b/tasks/installapp.yml index 38d3956..8c8d107 100644 --- a/tasks/installapp.yml +++ b/tasks/installapp.yml @@ -8,6 +8,10 @@ mode: 0644 notify: restart lufi +- name: '[INSTALL] - Remove local dir' + file: + path: '{{ lufi_app_dir }}' + state: 'absent' - name: '[INSTALL] - Install / Update lufi' command: 'carton install {{ lufi_build_options }}' @@ -15,4 +19,4 @@ chdir: '{{ lufi_app_dir }}' become: yes become_user: '{{ lufi_username }}' - notify: restart lufi + notify: restart lufi