瀏覽代碼

Make sure to remove 'install' directory if wallabag is already installed

Subsequent runs of wallabag's playbook result in the 'install' directory being
recreated, (after the "Clone wallabag" step) kicking wallabag's first time
setup procedure.

With this patch we automatically remove the 'install' directory if wallabag's
configuration file appears to be in place before cloning the repository.
Lorenzo Villani 10 年之前
父節點
當前提交
32ac785667
共有 1 個檔案被更改,包括 8 行新增0 行删除
  1. 8
    0
      roles/readlater/tasks/wallabag.yml

+ 8
- 0
roles/readlater/tasks/wallabag.yml 查看文件

@@ -1,8 +1,16 @@
1
+- name: Determine whether wallabag is configured
2
+  stat: path=/var/www/wallabag/inc/poche/config.inc.php
3
+  register: wallabag_config
4
+
1 5
 - name: Clone wallabag
2 6
   git: repo=https://github.com/wallabag/wallabag.git
3 7
        dest=/var/www/wallabag
4 8
        version={{ wallabag_version }}
5 9
 
10
+- name: Remove wallabag 'install' directory if its configuration file is there
11
+  file: name=/var/www/wallabag/install state=absent
12
+  when: wallabag_config.stat.exists == True
13
+
6 14
 - name: Install wallabag dependencies
7 15
   apt: pkg={{ item }} state=present
8 16
   with_items:

Loading…
取消
儲存