From d36712d014a5f2d72440666232a729d69bdcccc9 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 16 Oct 2020 11:34:43 -0400 Subject: [PATCH] Refactor scripting to custom for suse This makes it marginally easier to modify safely. Further, it moves progress to after custom scripting --- .../suse15/profiles/hpc/scripts/firstboot.custom | 9 +++++++++ .../suse15/profiles/hpc/scripts/firstboot.sh | 6 ++---- .../suse15/profiles/hpc/scripts/post.custom | 16 ++++++++++++++++ .../suse15/profiles/hpc/scripts/post.sh | 7 ++----- 4 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.custom create mode 100644 confluent_osdeploy/suse15/profiles/hpc/scripts/post.custom diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.custom b/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.custom new file mode 100644 index 00000000..e2b7f793 --- /dev/null +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.custom @@ -0,0 +1,9 @@ +#!/bin/sh + +# This script runs at the end of the final boot + +. /etc/confluent/functions + +# Custom scripts may go here +# run_remote example.sh +# run_remote_python example.py diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh b/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh index cea4c664..333f2e4a 100644 --- a/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/firstboot.sh @@ -7,9 +7,7 @@ mgr=$(grep ^deploy_server /etc/confluent/confluent.deploycfg|awk '{print $2}') profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|sed -e 's/^rootpassword: //') proto=$(grep ^protocol: /etc/confluent/confluent.deploycfg |awk '{print $2}') apikey=$(cat /etc/confluent/confluent.apikey) -curl --capath /etc/confluent/tls -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" -f -X POST -d "status: complete" https://$mgr/confluent-api/self/updatestatus . /etc/confluent/functions -# Custom scripts may go here -# run_remote example.sh -# run_remote_python example.py +run_remote firstboot.custom +curl --capath /etc/confluent/tls -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" -f -X POST -d "status: complete" https://$mgr/confluent-api/self/updatestatus diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/post.custom b/confluent_osdeploy/suse15/profiles/hpc/scripts/post.custom new file mode 100644 index 00000000..a841271b --- /dev/null +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/post.custom @@ -0,0 +1,16 @@ +#!/bin/sh + +# This script runs at the end of install in the installed system +# but still under the installer kernel. + +# This is a good place to run most customizations that do not have any +# dependency upon the install target kernel being active. + +# If there are dependencies on the kernel (drivers or special filesystems) +# then firstboot.sh would be the script to customize. + +. /etc/confluent/functions + +# Examples: +# run_remote script.sh +# run_remote_python script.py diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/post.sh b/confluent_osdeploy/suse15/profiles/hpc/scripts/post.sh index 85411e26..7111d781 100644 --- a/confluent_osdeploy/suse15/profiles/hpc/scripts/post.sh +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/post.sh @@ -21,10 +21,7 @@ chmod og-rwx /etc/confluent/* export mgr profile nodename . /etc/confluent/functions +run_remote post.custom + curl -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus -# Customizations may go here - -# Examples: -# run_remote script.sh -# run_remote_python script.py