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