Skip to content

Commit f473e59

Browse files
committed
Verify if the hostname reported by the agent heartbeat is correct.
Fixes #49. Signed-off-by: Andre Araujo <[email protected]>
1 parent 58b3001 commit f473e59

File tree

1 file changed

+9
-0
lines changed
  • roles/cloudera_manager/wait_for_heartbeat/tasks

1 file changed

+9
-0
lines changed

roles/cloudera_manager/wait_for_heartbeat/tasks/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@
2929
vars:
3030
heartbeat_time: "{{ host_status.json['lastHeartbeat'] | default('') }}"
3131
current_time: "{{ ansible_date_time.iso8601 }}"
32+
33+
- name: Ensure the hostname reported in the heartbeat matches the inventory name
34+
assert:
35+
that: "{{ cloudera_manager_host == host_status.json.hostname }}"
36+
success_msg: The hostname reported by the agent matches the expected
37+
fail_msg: >
38+
The hostname reported by the agent ({{ host_status.json.hostname }})
39+
doesn't match the expected ({{ cloudera_manager_host }}).
40+
Ensure the host entry in /etc/hosts starts with: {{ host_status.json.ipAddress }} {{ cloudera_manager_host }} ...

0 commit comments

Comments
 (0)