diff --git a/ansible/group_vars/all/all.yml b/ansible/group_vars/all/all.yml
index 371e2d897884f0e3c70f8e14e9c35c887f3eff70..d665541a82ba1c1fde0e9cda2e826c4af2e1e5f5 100644
--- a/ansible/group_vars/all/all.yml
+++ b/ansible/group_vars/all/all.yml
@@ -183,7 +183,7 @@ spark_yarn_extra_classpath: /usr/lib/hadoop/lib/native
 
 spark_driver_extra_classpath: '{%if use_absolute_paths %}{{spark_home_dir}}/{% endif %}{{hadoop_config_jar}}'
 
-spark_driver_java_opts: '{{service_url_java_opt}} {{cert_java_opt}} {%if with_kerberos_opts %}{{kerberos_jvm_opts}}{% endif %}'
+spark_driver_java_opts: '{{service_url_java_opt}} {{cert_java_opt}} {%if with_kerberos_properties %}{{kerberos_jvm_opts}}{% endif %}'
 
 spark_nxcals_python_artifact: 'nxcals-data-access-python3'
 
diff --git a/ansible/integration-tests-install.yml b/ansible/integration-tests-install.yml
index eddb88043ae00a93d6a8bc5e50cfa3e5cf8ff9e4..c431a3794ed548546730ba6b65aa079ba98fa12c 100644
--- a/ansible/integration-tests-install.yml
+++ b/ansible/integration-tests-install.yml
@@ -20,5 +20,5 @@
   roles:
     - { role: common-keytab, kerberos_encrypted_location: "./files/keytab-{{kerberos_principal}}-encrypted"}
 # The absolute path for the keystore file is needed, cause spark-defaults.conf will not otherwise locate the file
-    - { role: spark, with_kerberos_opts: true, cert_keystore_name: '{{spark_home_dir}}/nxcals_cacerts' }
+    - { role: spark, with_kerberos_properties: true, cert_keystore_name: '{{spark_home_dir}}/nxcals_cacerts' }
     - { role: integration-tests }
diff --git a/ansible/roles/spark/defaults/main.yml b/ansible/roles/spark/defaults/main.yml
index e3dac6df1f76cfad2f7648e49041f3174567f07f..fda315199c5b3dc45d4d0d765568385b0df996e9 100644
--- a/ansible/roles/spark/defaults/main.yml
+++ b/ansible/roles/spark/defaults/main.yml
@@ -1,2 +1,2 @@
 use_absolute_paths: true
-with_kerberos_opts: false
\ No newline at end of file
+with_kerberos_properties: false
\ No newline at end of file
diff --git a/ansible/roles/spark/templates/config/spark-defaults.conf b/ansible/roles/spark/templates/config/spark-defaults.conf
index 19ed35545d312239581f2be042c31ffffb6fb4cb..92c8ee2918fe3bac29f2b747143c1f200e5a01c6 100644
--- a/ansible/roles/spark/templates/config/spark-defaults.conf
+++ b/ansible/roles/spark/templates/config/spark-defaults.conf
@@ -71,8 +71,13 @@ spark.executor.extraClassPath   {{spark_yarn_extra_classpath}}
 #
 # spark.master
 
+{%if with_kerberos_properties %}
+spark.yarn.keytab   {{kerberos_keytab_location}}
+spark.yarn.principal    {{kerberos_principal}}
+{% else %}
 # You can uncomment the following kerberos properties to directly
 # configure spark against a kerberos keytab/principal entry
-#
+
 # spark.yarn.keytab
 # spark.yarn.principal
+{% endif %}
\ No newline at end of file