From d72bac5faf7059a9ea0cba2f37cabd366c44e742 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 24 Aug 2022 16:07:38 -0400 Subject: [PATCH] Add more to the SUSE profiles Add exetensibility to pre and sample directories --- .../hpc/scripts/firstboot.d/.gitignore | 0 .../profiles/hpc/scripts/post.d/.gitignore | 0 .../profiles/hpc/scripts/pre.d/.gitignore | 0 .../suse15/profiles/hpc/scripts/pre.sh | 23 +++++++++++-------- .../server/scripts/firstboot.d/.gitignore | 0 .../profiles/server/scripts/post.d/.gitignore | 0 .../profiles/server/scripts/pre.d/.gitignore | 0 .../suse15/profiles/server/scripts/pre.sh | 23 +++++++++++-------- 8 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.d/.gitignore create mode 100644 confluent_osdeploy/suse15/profiles/hpc/scripts/post.d/.gitignore create mode 100644 confluent_osdeploy/suse15/profiles/hpc/scripts/pre.d/.gitignore create mode 100644 confluent_osdeploy/suse15/profiles/server/scripts/firstboot.d/.gitignore create mode 100644 confluent_osdeploy/suse15/profiles/server/scripts/post.d/.gitignore create mode 100644 confluent_osdeploy/suse15/profiles/server/scripts/pre.d/.gitignore diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.d/.gitignore b/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.d/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/post.d/.gitignore b/confluent_osdeploy/suse15/profiles/hpc/scripts/post.d/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/pre.d/.gitignore b/confluent_osdeploy/suse15/profiles/hpc/scripts/pre.d/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/pre.sh b/confluent_osdeploy/suse15/profiles/hpc/scripts/pre.sh index 54fea7c2..7f386698 100644 --- a/confluent_osdeploy/suse15/profiles/hpc/scripts/pre.sh +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/pre.sh @@ -38,15 +38,20 @@ if grep ^ntpservers: /etc/confluent/confluent.deploycfg > /dev/null; then echo '' >> /tmp/ntp.cfg ntpcfg=$(paste -sd '' /tmp/ntp.cfg) fi -mdadm --assemble --scan -run_remote_python getinstalldisk -if grep ^md /tmp/installdisk > /dev/null; then - for md in /dev/disk/*/*; do - rmd=$(readlink $md) - if echo $rmd|grep $(cat /tmp/installdisk)$ > /dev/null; then - echo ${md#/dev/} > /tmp/installdisk - fi - done +export confluent_mgr confluent_profile nodename +run_remote pre.custom +run_remote_parts pre.d +if [ ! -e /tmp/installdisk ]; then + mdadm --assemble --scan + run_remote_python getinstalldisk + if grep ^md /tmp/installdisk > /dev/null; then + for md in /dev/disk/*/*; do + rmd=$(readlink $md) + if echo $rmd|grep $(cat /tmp/installdisk)$ > /dev/null; then + echo ${md#/dev/} > /tmp/installdisk + fi + done + fi fi sed -e s'!'%%INSTDISK%%'!'/dev/$(cat /tmp/installdisk)'!' -e s'!'%%NODENAME%%'!'$nodename'!' -e 's!!'"$ntpcfg"'!' -e "s?%%ROOTPASSWORD%%?${rootpw}?" /tmp/profile/autoinst.xml > /tmp/profile/modified.xml if grep append /tmp/bootloader.xml > /dev/null; then diff --git a/confluent_osdeploy/suse15/profiles/server/scripts/firstboot.d/.gitignore b/confluent_osdeploy/suse15/profiles/server/scripts/firstboot.d/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/confluent_osdeploy/suse15/profiles/server/scripts/post.d/.gitignore b/confluent_osdeploy/suse15/profiles/server/scripts/post.d/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/confluent_osdeploy/suse15/profiles/server/scripts/pre.d/.gitignore b/confluent_osdeploy/suse15/profiles/server/scripts/pre.d/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/confluent_osdeploy/suse15/profiles/server/scripts/pre.sh b/confluent_osdeploy/suse15/profiles/server/scripts/pre.sh index 54fea7c2..7f386698 100644 --- a/confluent_osdeploy/suse15/profiles/server/scripts/pre.sh +++ b/confluent_osdeploy/suse15/profiles/server/scripts/pre.sh @@ -38,15 +38,20 @@ if grep ^ntpservers: /etc/confluent/confluent.deploycfg > /dev/null; then echo '' >> /tmp/ntp.cfg ntpcfg=$(paste -sd '' /tmp/ntp.cfg) fi -mdadm --assemble --scan -run_remote_python getinstalldisk -if grep ^md /tmp/installdisk > /dev/null; then - for md in /dev/disk/*/*; do - rmd=$(readlink $md) - if echo $rmd|grep $(cat /tmp/installdisk)$ > /dev/null; then - echo ${md#/dev/} > /tmp/installdisk - fi - done +export confluent_mgr confluent_profile nodename +run_remote pre.custom +run_remote_parts pre.d +if [ ! -e /tmp/installdisk ]; then + mdadm --assemble --scan + run_remote_python getinstalldisk + if grep ^md /tmp/installdisk > /dev/null; then + for md in /dev/disk/*/*; do + rmd=$(readlink $md) + if echo $rmd|grep $(cat /tmp/installdisk)$ > /dev/null; then + echo ${md#/dev/} > /tmp/installdisk + fi + done + fi fi sed -e s'!'%%INSTDISK%%'!'/dev/$(cat /tmp/installdisk)'!' -e s'!'%%NODENAME%%'!'$nodename'!' -e 's!!'"$ntpcfg"'!' -e "s?%%ROOTPASSWORD%%?${rootpw}?" /tmp/profile/autoinst.xml > /tmp/profile/modified.xml if grep append /tmp/bootloader.xml > /dev/null; then