aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2013-11-26 03:55:03 +0200
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2013-11-26 03:55:03 +0200
commitda3951b106c3b3298930601899469e87c227c3b2 (patch)
tree94634e833118e4a0cc5cfbe00c950d6f0a4eab75
parente0c76217df4027fa2313e5b5515790a68b821706 (diff)
Include ../ansible-private-vars/main.yml only if exists.
But check and fail fast if we need Crowd credentials and they're not set.
-rw-r--r--ansible-deploy/jenkins.yml5
-rw-r--r--ansible-deploy/roles/jenkins/tasks/main.yml4
-rw-r--r--ansible-deploy/vars/empty.yml1
3 files changed, 9 insertions, 1 deletions
diff --git a/ansible-deploy/jenkins.yml b/ansible-deploy/jenkins.yml
index 4df2704..d915f86 100644
--- a/ansible-deploy/jenkins.yml
+++ b/ansible-deploy/jenkins.yml
@@ -10,7 +10,10 @@
# "native" or "crowd"
- jenkins_auth: crowd
vars_files:
- - ../ansible-private-vars/main.yml
+ # Include private settings only if they exist - not all modes need
+ # them (e.g. jenkins_auth: native).
+ # Following construct works as: find first file which exists and use it.
+ - ["../ansible-private-vars/main.yml", "vars/empty.yml"]
roles:
- common
- apache
diff --git a/ansible-deploy/roles/jenkins/tasks/main.yml b/ansible-deploy/roles/jenkins/tasks/main.yml
index f710a82..c7cf6ca 100644
--- a/ansible-deploy/roles/jenkins/tasks/main.yml
+++ b/ansible-deploy/roles/jenkins/tasks/main.yml
@@ -1,3 +1,7 @@
+- name: Verify Jenkins parameters
+ local_action: copy content="{{crowd_user}} {{crowd_passwd}}" dest=/dev/null
+ when: jenkins_auth == "crowd"
+
- name: Install Jenkins dependency packages
apt: pkg={{item}}
sudo: yes
diff --git a/ansible-deploy/vars/empty.yml b/ansible-deploy/vars/empty.yml
new file mode 100644
index 0000000..69c7f75
--- /dev/null
+++ b/ansible-deploy/vars/empty.yml
@@ -0,0 +1 @@
+__none__: __none__