Skip to content
Merged
3 changes: 3 additions & 0 deletions ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ controller:
truststore:
password: "{{ controllerKeystorePassword }}"
path: "/conf/{{ controllerKeystoreName }}"
extraEnv: "{{ controller_extraEnv | default({}) }}"

# move controller protocol outside to not evaluate controller variables during execution of setup.yml
controllerProtocolForSetup: "{{ controller_protocol | default('https') }}"
controllerKeystoreName: "{{ controllerKeyPrefix }}openwhisk-keystore.p12"
Expand Down Expand Up @@ -169,6 +171,7 @@ invoker:
jvmArgs: "{% if inventory_hostname in groups['invokers'] %}
{{ jmx.jvmCommonArgs }} -Djava.rmi.server.hostname={{ invokerHostname }} -Dcom.sun.management.jmxremote.rmi.port={{ jmx.rmiBasePortInvoker + groups['invokers'].index(inventory_hostname) }} -Dcom.sun.management.jmxremote.port={{ jmx.basePortInvoker + groups['invokers'].index(inventory_hostname) }}
{% endif %}"
extraEnv: "{{ invoker_extraEnv | default({}) }}"

userLogs:
spi: "{{ userLogs_spi | default('whisk.core.containerpool.logging.DockerToActivationLogStoreProvider') }}"
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/controller/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@

"CONFIG_whisk_transactions_header": "{{ transactions.header }}"

- name: merge extra env variables
set_fact:
controller_env: "{{ controller_env | combine(controller.extraEnv) }}"

- name: include plugins
include_tasks: "{{ item }}.yml"
with_items: "{{ controller_plugins | default([]) }}"
Expand Down
12 changes: 8 additions & 4 deletions ansible/roles/invoker/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

- name: prepare invoker env
set_fact:
env:
invoker_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 }}"
Expand Down Expand Up @@ -210,11 +210,15 @@
"CONFIG_whisk_activation_payload_max": "{{ limit_activation_payload | default() }}"
"CONFIG_whisk_transactions_header": "{{ transactions.header }}"

- name: extend invoker env
- name: extend invoker dns env
set_fact:
env: "{{ env|default({}) | combine( {'CONFIG_whisk_containerFactory_containerArgs_dnsServers_' ~ item.0: item.1} ) }}"
invoker_env: "{{ invoker_env | default({}) | combine( {'CONFIG_whisk_containerFactory_containerArgs_dnsServers_' ~ item.0: item.1} ) }}"
with_indexed_items: "{{ (invoker_container_network_dns_servers | default()).split(' ')}}"

- name: merge extra env variables
set_fact:
invoker_env: "{{ invoker_env | combine(invoker.extraEnv) }}"

- name: set invoker volumes
set_fact:
volumes: "/sys/fs/cgroup:/sys/fs/cgroup,/run/runc:/run/runc,\
Expand All @@ -239,7 +243,7 @@
image: "{{ docker_registry }}{{ docker.image.prefix }}/invoker:{{ docker.image.tag }}"
state: started
recreate: true
env: "{{ env }}"
env: "{{ invoker_env }}"
volumes: "{{ volumes }}"
ports: "{{ ports_to_expose }}"
command: /bin/sh -c "exec /init.sh {{ groups['invokers'].index(inventory_hostname) }} >> /logs/invoker{{ groups['invokers'].index(inventory_hostname) }}_logs.log 2>&1"
Expand Down