From fda61bd35479051676145303395b4daf8c46c0d1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 12 Oct 2021 16:58:42 -0400 Subject: [PATCH] Attempt to extend the v6 deployment support in el8 --- .../el8/profiles/default/kickstart | 33 +++++++++++++++++-- .../suse15/profiles/hpc/scripts/firstboot.sh | 11 ++++++- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/confluent_osdeploy/el8/profiles/default/kickstart b/confluent_osdeploy/el8/profiles/default/kickstart index 204694bd..740d8646 100644 --- a/confluent_osdeploy/el8/profiles/default/kickstart +++ b/confluent_osdeploy/el8/profiles/default/kickstart @@ -54,8 +54,17 @@ tar %include /tmp/kickstart.custom %pre +v6cfg=$(grep ^ipv6_method: /etc/confluent/confluent.deploycfg) +v6cfg=${v6cfg#ipv6_method: } +if [ "$v6cfg" = "static" ]; then + confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server_v6: } + confluent_mgr="[$confluent_mgr]" +else + confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server: } +fi confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg |awk '{print $2}') -confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg |awk '{print $2}') curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/pre.sh > /tmp/preinst.sh . /tmp/preinst.sh %end @@ -63,7 +72,16 @@ curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/pr %post --nochroot mkdir -p /mnt/sysimage/etc/confluent confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg |awk '{print $2}') -confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg |awk '{print $2}') +v6cfg=$(grep ^ipv6_method: /etc/confluent/confluent.deploycfg) +v6cfg=${v6cfg#ipv6_method: } +if [ "$v6cfg" = "static" ]; then + confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server_v6: } + confluent_mgr="[$confluent_mgr]" +else + confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server: } +fi curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/prechroot.sh > /tmp/postinst.sh . /tmp/postinst.sh @@ -80,7 +98,16 @@ systemctl enable firstboot chgrp ssh_keys /etc/ssh/ssh*key restorecon /etc/ssh/ssh*key /root/.shosts /etc/ssh/shosts.equiv /etc/ssh/ssh_config.d/* /opt/confluent/bin/firstboot.sh confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg |awk '{print $2}') -confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg |awk '{print $2}') +v6cfg=$(grep ^ipv6_method: /etc/confluent/confluent.deploycfg) +v6cfg=${v6cfg#ipv6_method: } +if [ "$v6cfg" = "static" ]; then + confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server_v6: } + confluent_mgr="[$confluent_mgr]" +else + confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server: } +fi curl -f https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/post.sh > /tmp/postinst.sh . /tmp/postinst.sh %end diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh b/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh index 02baa245..8aa6f496 100644 --- a/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh @@ -5,7 +5,16 @@ exec >> /var/log/confluent/confluent-firstboot.log exec 2>> /var/log/confluent/confluent-firstboot.log nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') -confluent_mgr=$(grep ^deploy_server /etc/confluent/confluent.deploycfg|awk '{print $2}') +v6cfg=$(grep ^ipv6_method: /etc/confluent/confluent.deploycfg) +v6cfg=${v6cfg#ipv6_method: } +if [ "$v6cfg" = "static" ]; then + confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server_v6: } + confluent_mgr="[$confluent_mgr]" +else + confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg) + confluent_mgr=${confluent_mgr#deploy_server: } +fi confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|sed -e 's/^rootpassword: //') proto=$(grep ^protocol: /etc/confluent/confluent.deploycfg |awk '{print $2}') confluent_apikey=$(cat /etc/confluent/confluent.apikey)