From 2036b66837a51a5848fe14bf3fd122de83e8a4d4 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 16 Jun 2019 17:11:25 +0800 Subject: [PATCH] feat(drone-server): verify that required server parameters --- defaults/main.yml | 3 --- tasks/drone-agent.yml | 2 +- tasks/drone-server.yml | 11 +++++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index ddfb7b9..3942ad8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,10 +1,7 @@ drone_server_enable: "false" drone_agent_enable: "false" drone_version: "latest" -drone_server_host: "" -drone_server_proto: "http" drone_tls_autocert: "false" -drone_rpc_secret: "" drone_agents_enabled: "true" drone_github_server: "https://github.com" drone_github_client_id: "" diff --git a/tasks/drone-agent.yml b/tasks/drone-agent.yml index 6edb7e3..dd2a8cd 100644 --- a/tasks/drone-agent.yml +++ b/tasks/drone-agent.yml @@ -4,7 +4,7 @@ msg: "Variable '{{ item }}' is not defined for drone agent setup" when: item not in vars with_items: - - drone_server_host + - drone_rpc_server tags: - configuration diff --git a/tasks/drone-server.yml b/tasks/drone-server.yml index 2584654..bf99e36 100644 --- a/tasks/drone-server.yml +++ b/tasks/drone-server.yml @@ -8,6 +8,17 @@ tags: - configuration +- name: verify that required server parameters + fail: + msg: "Variable '{{ item }}' is not defined for drone server setup" + when: item not in vars + with_items: + - drone_server_host + - drone_server_proto + - drone_rpc_secret + tags: + - configuration + - name: copy config for drone server template: src: "drone-server.env.j2"