Skip to content

Commit d05208b

Browse files
committed
compute init functionality for new nodes added to existing cluster
1 parent 19af5a9 commit d05208b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ansible/roles/compute_init/files/compute-init.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,20 @@
9595
- meta: end_play
9696
when: _mount_mnt_cluster.failed
9797

98+
- name: Check if hostvars exist
99+
stat:
100+
path: "/mnt/cluster/hostvars/{{ ansible_hostname }}/hostvars.yml"
101+
register: hostvars_stat
102+
103+
- block:
104+
- name: Report skipping initialization if host vars does not exist
105+
# meta: end_play produces no output
106+
debug:
107+
msg: "Skipping compute initialization: hostvars does not exist"
108+
109+
- meta: end_play
110+
when: not hostvars_stat.stat.exists
111+
98112
- name: Load hostvars from NFS
99113
# this is higher priority than vars block = normal ansible's hostvars
100114
include_vars:

0 commit comments

Comments
 (0)