2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-16 18:49:04 +00:00

Change ipv4_server to deploy_server

Use a more neutral name for the deployment server target.
It is still ipv4 only for the moment, but easier to pull in
ipv6 support when not having to change paths that don't care.
This commit is contained in:
Jarrod Johnson 2020-05-15 16:06:57 -04:00
parent a5adcbd496
commit b67140248e
7 changed files with 11 additions and 13 deletions

View File

@ -32,8 +32,8 @@ umask $oum
mgr="[$mgr]"
curl -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/deploycfg > /tmp/confluent.deploycfg
mgr=$(grep ^ipv4_server: /tmp/confluent.deploycfg)
mgr=${mgr#ipv4_server: }
mgr=$(grep ^deploy_server: /tmp/confluent.deploycfg)
mgr=${mgr#deploy_server: }
profilename=$(grep ^profile: /tmp/confluent.deploycfg)
profilename=${profilename#profile: }
proto=$(grep ^protocol: /tmp/confluent.deploycfg)

View File

@ -12,7 +12,7 @@ python3
%pre
profile=$(grep ^profile: /etc/confluent.deploycfg |awk '{print $2}')
mgr=$(grep ipv4_server /etc/confluent.deploycfg |awk '{print $2}')
mgr=$(grep deploy_server /etc/confluent.deploycfg |awk '{print $2}')
curl -f https://$mgr/confluent-public/os/$profile/scripts/pre.sh > /tmp/preinst.sh
. /tmp/preinst.sh
%end
@ -20,7 +20,7 @@ curl -f https://$mgr/confluent-public/os/$profile/scripts/pre.sh > /tmp/preinst.
%post --nochroot
mkdir -p /mnt/sysimage/etc/confluent
profile=$(grep ^profile: /etc/confluent.deploycfg |awk '{print $2}')
mgr=$(grep ipv4_server /etc/confluent.deploycfg |awk '{print $2}')
mgr=$(grep deploy_server /etc/confluent.deploycfg |awk '{print $2}')
curl -f https://$mgr/confluent-public/os/$profile/scripts/post.sh > /tmp/postinst.sh
. /tmp/postinst.sh

View File

@ -1,7 +1,7 @@
#!/bin/sh
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
apikey=$(cat /etc/confluent/confluent.apikey)
mgr=$(grep mgt_server /etc/confluent/confluent.deploycfg|awk '{print $2}')
mgr=$(grep deploy_server /etc/confluent/confluent.deploycfg|awk '{print $2}')
curl --capath /etc/confluent/tls -X POST -d 'status: complete' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus
systemctl disable firstboot
rm /etc/systemd/system/firstboot.service

View File

@ -75,8 +75,8 @@ else
done < /tmp/confluent.deploycfg
fi
echo done
mgr=$(grep ^ipv4_server: /tmp/confluent.deploycfg)
mgr=${mgr#ipv4_server: }
mgr=$(grep ^deploy_server: /tmp/confluent.deploycfg)
mgr=${mgr#deploy_server: }
profilename=$(grep ^profile: /tmp/confluent.deploycfg)
profilename=${profilename#profile: }
proto=$(grep ^protocol: /tmp/confluent.deploycfg)

View File

@ -36,7 +36,7 @@ elif [ "$ipv4m" = "static" ]; then
else
IP=off
fi
ipv4s=$(grep ^ipv4_server $deploycfg|awk '{print $2}')
ipv4s=$(grep ^deploy_server $deploycfg|awk '{print $2}')
osprofile=$(cat /custom-installation/confluent/osprofile)
fcmdline="$(cat /custom-installation/confluent/cmdline.orig) autoinstall ds=nocloud-net;s=https://${ipv4s}/confluent-public/os/${osprofile}/autoinstall/"
if [ -f /custom-installation/autocons.info ]; then

View File

@ -1,6 +1,6 @@
#!/bin/bash
deploycfg=/custom-installation/confluent/confluent.deploycfg
mgr=$(grep ^ipv4_server $deploycfg|awk '{print $2}')
mgr=$(grep ^deploy_server $deploycfg|awk '{print $2}')
cat /custom-installation/ssh/*.rootpubkey > /root/.ssh/authorized_keys
nodename=$(grep ^NODENAME: /custom-installation/confluent/confluent.info|awk '{print $2}')
apikey=$(cat /custom-installation/confluent/confluent.apikey)

View File

@ -171,7 +171,6 @@ def get_nic_config(configmanager, node, ip=None, mac=None, ifidx=None,
'ipv4_address': None,
'ipv4_method': None,
'prefix': None,
'ipv4_server': None,
}
nets = None
needsvrip = False
@ -188,8 +187,7 @@ def get_nic_config(configmanager, node, ip=None, mac=None, ifidx=None,
for net in nets:
net, prefix, svrip = net
candsrvs.append(svrip)
cfgdata['ipv4_server'] = svrip
cfgdata['mgt_server'] = svrip
cfgdata['deploy_server'] = svrip
for candidate in cfgbyname:
if cfgbyname[candidate].get('ipv4_method', None) == 'dhcp':
dhcprequested = True
@ -228,7 +226,7 @@ def get_nic_config(configmanager, node, ip=None, mac=None, ifidx=None,
break
for svr in candsrvs:
if ip_on_same_subnet(svr, ipbynodename, prefix):
cfgdata['ipv4_server'] = svr
cfgdata['deploy_server'] = svr
break
for gw in candgws:
if ip_on_same_subnet(gw, ipbynodename, prefix):