Skip to content

Commit 6efb53b

Browse files
switch to single file for the installation steps
1 parent 4014917 commit 6efb53b

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

scripts/install-chef-suse.sh

+16-24
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
set -e
2929

3030
crowbar_install_dir=/var/lib/crowbar/install
31+
installation_steps=$crowbar_install_dir/installation_steps
32+
33+
function set_step () {
34+
local step=$1
35+
echo "$step $(date -Iseconds)" >> $installation_steps
36+
}
3137

3238
touch $crowbar_install_dir/crowbar_installing
3339

@@ -289,20 +295,6 @@ ensure_service_running () {
289295
fi
290296
}
291297

292-
cleanup_steps () {
293-
for i in pre_sanity_checks \
294-
run_services \
295-
initial_chef_client \
296-
barclamp_install \
297-
bootstrap_crowbar_setup \
298-
apply_crowbar_config \
299-
transition_crowbar \
300-
chef_client_daemon \
301-
post_sanity_checks; do
302-
rm -f $crowbar_install_dir/${i}
303-
done
304-
}
305-
306298
if [ -f $crowbar_install_dir/crowbar-installed-ok ]; then
307299
run_succeeded=already_before
308300

@@ -319,7 +311,7 @@ fi
319311

320312
if [ -f $crowbar_install_dir/crowbar-install-failed ] || [ "$CROWBAR_WIZARD_MODE" ]; then
321313
rm -f $crowbar_install_dir/crowbar-install-failed
322-
cleanup_steps
314+
rm -f $installation_steps
323315
sqlite3 /opt/dell/crowbar_framework/db/production.sqlite3 "delete from proposals; delete from proposal_queues; vacuum;"
324316
fi
325317

@@ -627,7 +619,7 @@ if [ -n "$CROWBAR_FROM_GIT" ]; then
627619
# ubuntu admin node.
628620
fi
629621

630-
touch $crowbar_install_dir/pre_sanity_checks
622+
set_step "pre_sanity_checks"
631623

632624

633625
# Starting services
@@ -682,7 +674,7 @@ for service in $services; do
682674
ensure_service_running chef-${service}
683675
done
684676

685-
touch $crowbar_install_dir/run_services
677+
set_step "run_services"
686678

687679

688680
# Initial chef-client run
@@ -725,7 +717,7 @@ EOF
725717

726718
$chef_client
727719

728-
touch $crowbar_install_dir/initial_chef_client
720+
set_step "initial_chef_client"
729721

730722

731723
# Barclamp installation
@@ -780,7 +772,7 @@ if test -d $BARCLAMP_SRC/hyperv; then
780772
/opt/dell/bin/barclamp_install.rb $BARCLAMP_INSTALL_OPTS hyperv
781773
fi
782774

783-
touch $crowbar_install_dir/barclamp_install
775+
set_step "barclamp_install"
784776

785777
# First step of crowbar bootstrap
786778
# -------------------------------
@@ -810,7 +802,7 @@ $chef_client
810802
# OOC, what, if anything, is responsible for starting rainbows/crowbar under bluepill?
811803
ensure_service_running crowbar
812804

813-
touch $crowbar_install_dir/bootstrap_crowbar_setup
805+
set_step "bootstrap_crowbar_setup"
814806

815807

816808
# Second step of crowbar bootstrap
@@ -1054,7 +1046,7 @@ done
10541046

10551047
# BMC support?
10561048

1057-
touch $crowbar_install_dir/apply_crowbar_config
1049+
set_step "apply_crowbar_config"
10581050

10591051

10601052
# Third step of crowbar bootstrap
@@ -1094,7 +1086,7 @@ done
10941086
# OK, let looper_chef_client run normally now.
10951087
rm /var/run/crowbar/deploying
10961088

1097-
touch $crowbar_install_dir/transition_crowbar
1089+
set_step "transition_crowbar"
10981090

10991091

11001092
# Starting more services
@@ -1106,7 +1098,7 @@ echo_summary "Starting chef-client"
11061098
chkconfig chef-client on
11071099
ensure_service_running chef-client
11081100

1109-
touch $crowbar_install_dir/chef_client_daemon
1101+
set_step "chef_client_daemon"
11101102

11111103

11121104
# Final sanity checks
@@ -1135,7 +1127,7 @@ for s in dhcpd apache2 ; do
11351127
fi
11361128
done
11371129

1138-
touch $crowbar_install_dir/post_sanity_checks
1130+
set_step "post_sanity_checks"
11391131

11401132
# We're done!
11411133
# -----------

0 commit comments

Comments
 (0)