From b67140248e4ceb7a08a29f6d8ea779de63cce4ff Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 15 May 2020 16:06:57 -0400 Subject: [PATCH] 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. --- .../usr/lib/dracut/hooks/initqueue/01-confluent.sh | 4 ++-- confluent_osdeploy/el8/profiles/default/kickstart | 4 ++-- .../el8/profiles/default/scripts/firstboot.sh | 2 +- .../suse15/initramfs/opt/confluent/bin/suseagent | 4 ++-- .../initramfs/custom-installation/hooks/casper-bottom.sh | 2 +- .../ubuntu20.04/initramfs/custom-installation/pre.sh | 2 +- confluent_server/confluent/netutil.py | 6 ++---- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh index 4a224b0c..37688e66 100644 --- a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh +++ b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh @@ -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) diff --git a/confluent_osdeploy/el8/profiles/default/kickstart b/confluent_osdeploy/el8/profiles/default/kickstart index f5ab4aa6..1ef6acc8 100644 --- a/confluent_osdeploy/el8/profiles/default/kickstart +++ b/confluent_osdeploy/el8/profiles/default/kickstart @@ -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 diff --git a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh index c625af41..6101c019 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh @@ -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 diff --git a/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent b/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent index 769ff45e..18abd1a2 100755 --- a/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent +++ b/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent @@ -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) diff --git a/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh b/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh index e72e6658..8b3c825c 100755 --- a/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh +++ b/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh @@ -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 diff --git a/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/pre.sh b/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/pre.sh index ea0d3dc3..44a440d4 100755 --- a/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/pre.sh +++ b/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/pre.sh @@ -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) diff --git a/confluent_server/confluent/netutil.py b/confluent_server/confluent/netutil.py index f5d3f16c..100da8b0 100644 --- a/confluent_server/confluent/netutil.py +++ b/confluent_server/confluent/netutil.py @@ -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):