Skip to content

Commit

Permalink
Allow configure java params for ODL karaf
Browse files Browse the repository at this point in the history
Allow configure memory limits as variables in ODL karaf
java instance.
Allows us to define smaller memory settings for CI
and bigger for prod environments.

Change-Id: I8cafaa543ad09572bdbb6af1bbbd65f55fe42f8c
  • Loading branch information
xNaaro committed Sep 14, 2018
1 parent 8219542 commit 292f7c2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions ansible/roles/opendaylight/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ opendaylight_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ do
opendaylight_tag: "{{ openstack_release }}"
opendaylight_image_full: "{{ opendaylight_image }}:{{ opendaylight_tag }}"
opendaylight_dimensions: "{{ default_container_dimensions }}"

###################
# Java Opts
###################

# JAVA_MAX_MEM param
opendaylight_java_max_mem: "8g"
# JAVA_MAX_PERM_MEM param
opendaylight_java_max_perm_mem: "512m"
10 changes: 6 additions & 4 deletions ansible/roles/opendaylight/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,15 @@

- name: Copying over setenv
template:
src: "{{ role_path }}/templates/setenv.j2"
dest: "{{ node_config_directory }}/{{ item }}/setenv"
src: "{{ item }}"
dest: "{{ node_config_directory }}/opendaylight/setenv"
mode: "0660"
become: true
register: opendaylight_config_env
with_items:
- "opendaylight"
with_first_found:
- "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/setenv"
- "{{ node_custom_config }}/opendaylight/setenv"
- "{{ role_path }}/templates/setenv.j2"
notify:
- Restart opendaylight container

Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/opendaylight/templates/setenv.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#

if [ "x$JAVA_MAX_PERM_MEM" = "x" ]; then
export JAVA_MAX_PERM_MEM="512m"
export JAVA_MAX_PERM_MEM="{{ opendaylight_java_max_perm_mem }}"
fi
if [ "x$JAVA_MAX_MEM" = "x" ]; then
export JAVA_MAX_MEM="8g"
export JAVA_MAX_MEM="{{ opendaylight_java_max_mem }}"
fi

0 comments on commit 292f7c2

Please sign in to comment.