From 52e046bce2c131f6c4a942c955e1e063fb084fae Mon Sep 17 00:00:00 2001 From: William Dyson Date: Tue, 20 Jul 2021 11:31:02 +0100 Subject: [PATCH 1/3] updated error message for missing tls var Signed-off-by: William Dyson --- roles/verify/definition/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/verify/definition/tasks/main.yml b/roles/verify/definition/tasks/main.yml index 5a3b92b7..24a3b312 100644 --- a/roles/verify/definition/tasks/main.yml +++ b/roles/verify/definition/tasks/main.yml @@ -29,7 +29,9 @@ success_msg: "TLS is configured on a set of nodes" fail_msg: >- TLS certificate distribution is not configured in the cluster inventory - file (set manual_tls_cert_distribution if this is intentional) + file. + If this is intential, set manual_tls_cert_distribution=true. + Otherwise, set tls=true for each host requiring a certificate. when: has_tls and not (manual_tls_cert_distribution | default(false)) - name: Ensure that TLS distribution is not configured in the inventory assert: From 06644b829fa4895026acfc38da832872c0887d06 Mon Sep 17 00:00:00 2001 From: William Dyson Date: Tue, 20 Jul 2021 12:26:55 +0100 Subject: [PATCH 2/3] added error message for when a template cannot be found in groupby Signed-off-by: William Dyson --- roles/deployment/groupby/tasks/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/deployment/groupby/tasks/main.yml b/roles/deployment/groupby/tasks/main.yml index 3e48ad0d..3aa15dc8 100644 --- a/roles/deployment/groupby/tasks/main.yml +++ b/roles/deployment/groupby/tasks/main.yml @@ -19,10 +19,15 @@ key: "{{ 'host_template_' ~ host_template if host_template is defined else 'no_template' }}" - name: Find the correct host template - set_fact: - host_template_content: "{{ _pre_template_cluster | json_query(query) | first }}" + block: + - fail: + msg: "Unable to host template {{ host_template }} in the cluster definition" + when: content | length == 0 + - set_fact: + host_template_content: "{{ content | first }}" vars: query: "clusters[].host_templates[].\"{{ host_template }}\"" + content: "{{ _pre_template_cluster | json_query(query) }}" when: host_template is defined - name: Group by service From fdea8d4b84418671f1934e973af0f826435b5f4a Mon Sep 17 00:00:00 2001 From: William Dyson Date: Thu, 23 Sep 2021 15:52:21 +0100 Subject: [PATCH 3/3] added Tez gateway verify check Signed-off-by: William Dyson --- .../parcels_and_roles/tasks/check_template_roles.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/verify/parcels_and_roles/tasks/check_template_roles.yml b/roles/verify/parcels_and_roles/tasks/check_template_roles.yml index 6ab4be79..2efc625c 100644 --- a/roles/verify/parcels_and_roles/tasks/check_template_roles.yml +++ b/roles/verify/parcels_and_roles/tasks/check_template_roles.yml @@ -22,6 +22,7 @@ | map('regex_replace','/.+','') | difference(role_mappings[template.service] | list) }} + - name: Ensure the host template service roles are valid assert: that: "{{ invalid_roles | length == 0 }}" @@ -31,3 +32,12 @@ fail_msg: >- Unknown role(s) {{ invalid_roles }} for service '{{ template.service }}' defined in host template '{{ host_template.name }}'. + + - name: Ensure the Tez gateway has been deployed + assert: + that: "{{ 'GATEWAY' in (host_template.mappings['TEZ'] | default({})) }}" + success_msg: The Tez gateway has been included as required + fail_msg: The Tez gateway should be colocated with Hive On Tez roles + when: + - template.service == 'HIVE_ON_TEZ' + - "'HIVESERVER2' in template.roles or 'GATEWAY' in template.roles"