Skip to content

Commit f828949

Browse files
authored
Fixed handling of custom roleConfig Groups (#46)
* Fixed handling of custom roleConfigGroups. When a roleConfigGroup was referenced in multiple templates it would be duplicated in the final cluster template. This fix removes the duplication. Signed-off-by: Andre Araujo <[email protected]> * Removed deprecated SMM parameters from template. Signed-off-by: Andre Araujo <[email protected]> * Made error message more informative. Signed-off-by: Andre Araujo <[email protected]>
1 parent e60261d commit f828949

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

plugins/filter/filters.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,17 @@ def extract_role_and_group(self, role_spec):
211211
return (role, template_group)
212212

213213
def extract_custom_roles(self, host_templates, service):
214-
custom_roles = []
214+
custom_roles = set([])
215215
for role_mapping in host_templates.values():
216216
if service in role_mapping:
217217
for custom_role in filter(lambda x: '/' in x, role_mapping[service]):
218-
custom_roles.append(custom_role)
219-
return custom_roles
218+
custom_roles.add(custom_role)
219+
return list(custom_roles)
220220

221221
def extract_custom_role_groups(self, host_templates):
222-
custom_role_groups = []
222+
custom_role_groups = set([])
223223
for role_mapping in host_templates.values():
224224
for (service, roles) in role_mapping.items():
225225
for custom_role in filter(lambda x: '/' in x, roles):
226-
custom_role_groups.append("-".join([service.lower()] + custom_role.split("/")))
227-
return custom_role_groups
226+
custom_role_groups.add("-".join([service.lower()] + custom_role.split("/")))
227+
return list(custom_role_groups)

roles/config/cluster/base/templates/configs/kerberos-6.x-7.x.j2

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,3 @@ SPARK3_ON_YARN:
3030
GATEWAY:
3131
spark_io_encryption_enabled: true
3232
spark_network_encryption_enabled: true
33-
STREAMS_MESSAGING_MANAGER:
34-
STREAMS_MESSAGING_MANAGER_SERVER:
35-
streams.messaging.manager.kafka.client.security.protocol: {{ cluster.security.tls | default(false) | ternary('SASL_SSL', 'SASL_PLAINTEXT') }}

roles/config/cluster/base/templates/configs/tls-cm-7.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ STREAMS_MESSAGING_MANAGER:
201201
ssl_server_keystore_keypassword: {{ tls_keystore_password }}
202202
ssl_server_keystore_location: {{ tls_keystore_path_generic }}
203203
ssl_server_keystore_password: {{ tls_keystore_password }}
204-
streams.messaging.manager.kafka.client.security.protocol: {{ cluster.security.kerberos | default(false) | ternary('SASL_SSL', 'SSL') }}
205204
STREAMS_MESSAGING_MANAGER_UI:
206205
ssl_client_truststore_location: {{ tls_chain_path }}
207206
ssl_enabled: true

roles/verify/parcels_and_roles/tasks/check_template_roles.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
fail_msg: >-
3333
Unknown role(s) {{ invalid_roles }} for service '{{ template.service }}'
3434
defined in host template '{{ host_template.name }}'.
35+
Valid roles are: {{ role_mappings[template.service] | list }}.
3536
3637
- name: Ensure the Tez gateway has been deployed
3738
assert:

0 commit comments

Comments
 (0)