From 0e42b32a1a7757a705d801663645601ac7b8d5aa Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 15 Jun 2019 23:07:01 +0800 Subject: [PATCH] feat: update sqlite folder --- defaults/main.yml | 4 ++-- tasks/drone-server.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index c20aa8d..dccc7bf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,3 @@ ---- drone_server_enable: "false" drone_agent_enable: "false" drone_version: "latest" @@ -12,7 +11,8 @@ drone_github_client_id: "" drone_github_client_secret: "" drone_logs_pretty: "true" drone_logs_color: "true" -drone_dir: "/var/lib/drone" drone_rpc_server: "http://drone-server" drone_runner_capacity: "3" drone_host_port: "8080" +drone_database_driver: "sqlite" +drone_sqlite_dir: "/var/lib/drone" diff --git a/tasks/drone-server.yml b/tasks/drone-server.yml index d560c77..6f2790e 100644 --- a/tasks/drone-server.yml +++ b/tasks/drone-server.yml @@ -9,11 +9,11 @@ - name: Creates sqlite directory file: - path: "{{ item }}" + path: "{{ drone_sqlite_dir }}" state: directory mode: 0755 - with_items: - - "{{ drone_dir }}" + when: drone_database_driver == "sqlite" + register: drone_sqlite_folder tags: - drone-server @@ -26,8 +26,9 @@ ports: - "{{ drone_host_port }}:80" volumes: - - "{{ drone_dir }}:/data" + - "{{ drone_sqlite_dir }}:/data" env_file: /etc/drone/drone-server.env - when: drone_server_config is defined and drone_server_config.changed + when: (drone_server_config is defined and drone_server_config.changed) or + (drone_sqlite_folder is defined and drone_sqlite_folder.changed) tags: - drone-server