From a5adcbd496c7fffd87236a35edbeac41bde7e1e2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 15 May 2020 16:03:25 -0400 Subject: [PATCH] Add firstboot to EL Also add 'mgt_server' rather than 'ipv4_server'. Will move to this. The server should be able to dictate the right address without the deploymennt image having to keep track. --- .../el8/profiles/default/scripts/firstboot.sh | 7 +++++++ confluent_server/confluent/netutil.py | 1 + 2 files changed, 8 insertions(+) create mode 100644 confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh diff --git a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh new file mode 100644 index 00000000..c625af41 --- /dev/null +++ b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh @@ -0,0 +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}') +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_server/confluent/netutil.py b/confluent_server/confluent/netutil.py index 0bd5345c..f5d3f16c 100644 --- a/confluent_server/confluent/netutil.py +++ b/confluent_server/confluent/netutil.py @@ -189,6 +189,7 @@ def get_nic_config(configmanager, node, ip=None, mac=None, ifidx=None, net, prefix, svrip = net candsrvs.append(svrip) cfgdata['ipv4_server'] = svrip + cfgdata['mgt_server'] = svrip for candidate in cfgbyname: if cfgbyname[candidate].get('ipv4_method', None) == 'dhcp': dhcprequested = True