You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2017/10/16 09:58:42 UTC

[incubator-openwhisk] branch master updated: Add check to controller and invoker that required databases exist. (#2838)

This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new b4aa01e  Add check to controller and invoker that required databases exist. (#2838)
b4aa01e is described below

commit b4aa01e2dec80f21b097cdbaa0a6b824f7ac8eed
Author: Christian Bickel <gi...@cbickel.de>
AuthorDate: Mon Oct 16 11:58:39 2017 +0200

    Add check to controller and invoker that required databases exist. (#2838)
---
 ansible/roles/controller/tasks/deploy.yml |  9 +++++++++
 ansible/roles/invoker/tasks/deploy.yml    |  8 ++++++++
 ansible/tasks/db/checkDb.yml              | 12 ++++++++++++
 3 files changed, 29 insertions(+)

diff --git a/ansible/roles/controller/tasks/deploy.yml b/ansible/roles/controller/tasks/deploy.yml
index c640034..3afb764 100644
--- a/ansible/roles/controller/tasks/deploy.yml
+++ b/ansible/roles/controller/tasks/deploy.yml
@@ -16,6 +16,15 @@
     mode: 0777
   become: "{{ logs.dir.become }}"
 
+- name: check, that required databases exist
+  include: "{{ openwhisk_home }}/ansible/tasks/db/checkDb.yml"
+  vars:
+    dbName: "{{ item }}"
+  with_items:
+  - "{{ db.whisk.actions }}"
+  - "{{ db.whisk.auth }}"
+  - "{{ db.whisk.activations }}"
+
 - name: create seed nodes list
   set_fact:
     seed_nodes_list: "{{ seed_nodes_list | default([]) }} + [ \"{{item.1}}:{{controller.akka.cluster.basePort+item.0}}\" ]"
diff --git a/ansible/roles/invoker/tasks/deploy.yml b/ansible/roles/invoker/tasks/deploy.yml
index 7cf606b..75df82e 100644
--- a/ansible/roles/invoker/tasks/deploy.yml
+++ b/ansible/roles/invoker/tasks/deploy.yml
@@ -53,6 +53,14 @@
     mode: 0777
   become: "{{ logs.dir.become }}"
 
+- name: check, that required databases exist
+  include: "{{ openwhisk_home }}/ansible/tasks/db/checkDb.yml"
+  vars:
+    dbName: "{{ item }}"
+  with_items:
+  - "{{ db.whisk.actions }}"
+  - "{{ db.whisk.activations }}"
+
 - name: define options when deploying invoker on Ubuntu
   set_fact:
     linuxOptions: "-v /usr/lib/x86_64-linux-gnu/libapparmor.so.1:/usr/lib/x86_64-linux-gnu/libapparmor.so.1"
diff --git a/ansible/tasks/db/checkDb.yml b/ansible/tasks/db/checkDb.yml
new file mode 100644
index 0000000..875618b
--- /dev/null
+++ b/ansible/tasks/db/checkDb.yml
@@ -0,0 +1,12 @@
+---
+# Checks, that the Database exists
+# dbName - name of the database to check
+
+- name: check if {{ dbName }} with {{ db_provider }} exists
+  uri:
+    url: "{{ db_protocol }}://{{ db_host }}:{{ db_port }}/{{ dbName }}"
+    method: HEAD
+    status_code: 200
+    user: "{{ db_username }}"
+    password: "{{ db_password }}"
+    force_basic_auth: yes

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].