Skip to content

Commit

Permalink
add support for custom config groups in cluster update
Browse files Browse the repository at this point in the history
Signed-off-by: Anis FATHALLAH <[email protected]>
  • Loading branch information
anisf committed Nov 1, 2023
1 parent a9208a4 commit 46f40cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% import 'cm_api.j2' as cm_api with context %}
{{ cm_api.ApiConfigList(merged_configs[service][role_type][custom_role]) }}
26 changes: 26 additions & 0 deletions roles/deployment/cluster/templates/services/service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@
{%- endfor -%}
{%- endfor -%}

{%- for custom_role in cluster.host_templates | cloudera.cluster.extract_custom_roles(service) -%}
{%- set (role_type, config_group) = custom_role | cloudera.cluster.extract_role_and_group -%}
{%- for host in (groups[service_ref + '_' + role_type | lower + '/' + config_group] | default([])) -%}
{{ role_joiner() }}
{
"type" : "{{ role_type }}",
"hostRef" : {
"hostId" : "{{ cloudera_manager_api_hosts[host]['id'] }}"
},
"roleConfigGroupRef" : {
"roleConfigGroupName" : "{{ service_ref }}-{{ role_type }}-{{ config_group }}"
}
}
{%- endfor -%}
{%- endfor -%}
{%- endif -%}
],
"roleConfigGroups": [
Expand All @@ -47,6 +62,17 @@
"base": true
}
{%- endfor -%}
{%- for custom_role in cluster.host_templates | cloudera.cluster.extract_custom_roles(service) -%}
{%- set (role_type, config_group) = custom_role | cloudera.cluster.extract_role_and_group -%}
{{ role_group_sep() }}
{
"name": "{{ service_ref }}-{{ role_type }}-{{ config_group }}",
"roleType": "{{ role_type }}",
{% set config_sep = joiner(",") -%}
"config": {%- include 'services/roleConfigGroupConfig_custom.j2' -%},
"base": false
}
{%- endfor -%}
{%- endif -%}
]
}
Expand Down

0 comments on commit 46f40cd

Please sign in to comment.