Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for custom config groups in cluster update #154

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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][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 | lower] | 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
Loading