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

dubeejw 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 063cb66  Pass config via file (#4309)
063cb66 is described below

commit 063cb6699296b01c30d2a2ea6ce9ec1b33e328dc
Author: Chetan Mehrotra <[email protected]>
AuthorDate: Thu Mar 7 21:37:44 2019 +0530

    Pass config via file (#4309)
---
 ansible/roles/controller/tasks/deploy.yml    | 6 +++++-
 ansible/roles/controller/templates/config.j2 | 8 ++++++++
 ansible/roles/invoker/tasks/deploy.yml       | 6 ++++++
 ansible/roles/invoker/templates/config.j2    | 8 ++++++++
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/ansible/roles/controller/tasks/deploy.yml 
b/ansible/roles/controller/tasks/deploy.yml
index a03fd9f..83d522e 100644
--- a/ansible/roles/controller/tasks/deploy.yml
+++ b/ansible/roles/controller/tasks/deploy.yml
@@ -118,6 +118,10 @@
       -Dcom.sun.management.jmxremote.rmi.port={{ jmx_remote_rmi_port }}
       -Dcom.sun.management.jmxremote.port={{ jmx_remote_port }}
 
+- name: Load config from template
+  set_fact:
+      openwhisk_config: "{{ lookup('template', 'config.j2') | b64encode }}"
+
 - name: populate environment variables for controller
   set_fact:
     env:
@@ -131,7 +135,7 @@
       "CONTROLLER_OPTS": "{{ controller_args | default(controller.arguments) 
}}"
       "CONTROLLER_INSTANCES": "{{ controller.instances }}"
       "JMX_REMOTE": "{{ jmx.enabled }}"
-
+      "OPENWHISK_ENCODED_CONFIG": "{{ openwhisk_config }}"
       "PORT": "8080"
       "TZ": "{{ docker.timezone }}"
 
diff --git a/ansible/roles/controller/templates/config.j2 
b/ansible/roles/controller/templates/config.j2
new file mode 100644
index 0000000..fecc43b
--- /dev/null
+++ b/ansible/roles/controller/templates/config.j2
@@ -0,0 +1,8 @@
+include classpath("application.conf")
+
+# Specify any custom config here. For example
+# whisk {
+#   metrics {
+#     prometheus-enabled = true
+#   }
+# }
diff --git a/ansible/roles/invoker/tasks/deploy.yml 
b/ansible/roles/invoker/tasks/deploy.yml
index 91c0144..09f0daf 100644
--- a/ansible/roles/invoker/tasks/deploy.yml
+++ b/ansible/roles/invoker/tasks/deploy.yml
@@ -183,12 +183,18 @@
   set_fact:
     invoker_ports_to_expose: "{{ invoker_ports_to_expose }} + [ \"{{ 
jmx.basePortInvoker + (invoker_index | int) }}:{{ jmx.basePortInvoker + 
(invoker_index | int) }}\" ] + [ \"{{ jmx.rmiBasePortInvoker + (invoker_index | 
int) }}:{{ jmx.rmiBasePortInvoker + (invoker_index | int) }}\" ]"
 
+
+- name: Load config from template
+  set_fact:
+    openwhisk_config: "{{ lookup('template', 'config.j2') | b64encode }}"
+
 - name: populate environment variables for invoker
   set_fact:
     env:
       "JAVA_OPTS": "-Xmx{{ invoker.heap }} -XX:+CrashOnOutOfMemoryError 
-XX:+UseGCOverheadLimit -XX:ErrorFile=/logs/java_error.log"
       "INVOKER_OPTS": "{{ invoker_args | default(invoker.arguments) }}"
       "JMX_REMOTE": "{{ jmx.enabled }}"
+      "OPENWHISK_ENCODED_CONFIG": "{{ openwhisk_config }}"
       "PORT": "8080"
       "TZ": "{{ docker.timezone }}"
       "KAFKA_HOSTS": "{{ kafka_connect_string }}"
diff --git a/ansible/roles/invoker/templates/config.j2 
b/ansible/roles/invoker/templates/config.j2
new file mode 100644
index 0000000..943769c
--- /dev/null
+++ b/ansible/roles/invoker/templates/config.j2
@@ -0,0 +1,8 @@
+include classpath("application.conf")
+
+# Specify any custom config here. For example
+# whisk {
+#   metrics {
+#     prometheus-enabled = true
+#   }
+# }
\ No newline at end of file

Reply via email to