diff --git a/ansible/roles/opendaylight/defaults/main.yml b/ansible/roles/opendaylight/defaults/main.yml
index 2383fe6300d4e24257ef0bdf435dccea630b5393..b5d026ec00e97f726a8c9da6222d62e09d60818e 100644
--- a/ansible/roles/opendaylight/defaults/main.yml
+++ b/ansible/roles/opendaylight/defaults/main.yml
@@ -51,3 +51,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"
diff --git a/ansible/roles/opendaylight/tasks/config.yml b/ansible/roles/opendaylight/tasks/config.yml
index 2c94f29b26c66f16c6165421b4c45fa7854bb567..921817497c697455ccd25754601f2f60bcd27392 100644
--- a/ansible/roles/opendaylight/tasks/config.yml
+++ b/ansible/roles/opendaylight/tasks/config.yml
@@ -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
 
diff --git a/ansible/roles/opendaylight/templates/setenv.j2 b/ansible/roles/opendaylight/templates/setenv.j2
index 7376186e1836e894dfb3a8bc22b1e3860ab74f85..969671760256e3a66176ce8ba78b4aaf41be07bd 100644
--- a/ansible/roles/opendaylight/templates/setenv.j2
+++ b/ansible/roles/opendaylight/templates/setenv.j2
@@ -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