@@ -85,6 +85,7 @@ function custom_ntp(){
8585 if [ -n " $NTP_SERVERS " ]; then
8686 cp assets/templates/98_worker-chronyd-custom.yaml.optional assets/generated/98_worker-chronyd-custom.yaml
8787 cp assets/templates/98_master-chronyd-custom.yaml.optional assets/generated/98_master-chronyd-custom.yaml
88+
8889 NTPFILECONTENT=$( cat assets/files/etc/chrony.conf)
8990 for ntp in $( echo $NTP_SERVERS | tr " ;" " \n" ) ; do
9091 NTPFILECONTENT=" ${NTPFILECONTENT} " $' \n ' " pool ${ntp} iburst"
@@ -224,9 +225,22 @@ function node_map_to_install_config_hosts() {
224225 start_idx=" $2 "
225226 role=" $3 "
226227
227- for (( idx= $start_idx ;idx< $(($1 + $start_idx )) ; idx++)); do
228+ # If arbiter is enabled, an arbiter node will be created so we increase the number of hosts by 1
229+ # when the role is for master to capture the arbiter position.
230+ # If the role is for a worker, we increment the index since the worker position has moved by 1.
231+ if [[ ! -z " ${ENABLE_ARBITER:- } " && " $role " == " master" ]]; then
232+ num_hosts=$(( num_hosts + 1 ))
233+ elif [[ ! -z " ${ENABLE_ARBITER:- } " && " $role " == " worker" ]]; then
234+ start_idx=$(( start_idx + 1 ))
235+ fi
236+
237+ for (( idx= $start_idx ;idx< $(($num_hosts + $start_idx )) ; idx++)); do
228238 name=$( node_val ${idx} " name" )
229239 mac=$( node_val ${idx} " ports[0].address" )
240+ local node_role=$role
241+ if [[ ! -z " ${ENABLE_ARBITER:- } " && $name =~ " arbiter" && " $role " == " master" ]]; then
242+ node_role=arbiter
243+ fi
230244
231245 driver=$( node_val ${idx} " driver" )
232246 if [ $driver == " ipmi" ] ; then
@@ -247,7 +261,7 @@ function node_map_to_install_config_hosts() {
247261
248262 cat << EOF
249263 - name: ${name}
250- role: ${role }
264+ role: ${node_role }
251265 bmc:
252266 address: ${address}
253267 username: ${username}
266280 # FIXME(stbenjam) Worker code in installer should accept
267281 # "default" as well -- currently the mapping doesn't work,
268282 # so we use the raw value for BMO's default which is "unknown"
269- if [[ " $role " == " master" ]]; then
283+ if [[ " $node_role " == " master" ]] || [[ " $node_role " == " arbiter " ]] ; then
270284 if [ -z " ${MASTER_HARDWARE_PROFILE:- } " ]; then
271285 cat << EOF
272286 rootDeviceHints:
0 commit comments