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

Helpful errors #42

Merged
merged 3 commits into from
Dec 21, 2021
Merged
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
9 changes: 7 additions & 2 deletions roles/deployment/groupby/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion roles/verify/definition/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions roles/verify/parcels_and_roles/tasks/check_template_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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"