28
28
set -e
29
29
30
30
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
+ }
31
37
32
38
touch $crowbar_install_dir /crowbar_installing
33
39
@@ -289,20 +295,6 @@ ensure_service_running () {
289
295
fi
290
296
}
291
297
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
-
306
298
if [ -f $crowbar_install_dir /crowbar-installed-ok ]; then
307
299
run_succeeded=already_before
308
300
319
311
320
312
if [ -f $crowbar_install_dir /crowbar-install-failed ] || [ " $CROWBAR_WIZARD_MODE " ]; then
321
313
rm -f $crowbar_install_dir /crowbar-install-failed
322
- cleanup_steps
314
+ rm -f $installation_steps
323
315
sqlite3 /opt/dell/crowbar_framework/db/production.sqlite3 " delete from proposals; delete from proposal_queues; vacuum;"
324
316
fi
325
317
@@ -627,7 +619,7 @@ if [ -n "$CROWBAR_FROM_GIT" ]; then
627
619
# ubuntu admin node.
628
620
fi
629
621
630
- touch $crowbar_install_dir / pre_sanity_checks
622
+ set_step " pre_sanity_checks"
631
623
632
624
633
625
# Starting services
@@ -682,7 +674,7 @@ for service in $services; do
682
674
ensure_service_running chef-${service}
683
675
done
684
676
685
- touch $crowbar_install_dir / run_services
677
+ set_step " run_services"
686
678
687
679
688
680
# Initial chef-client run
725
717
726
718
$chef_client
727
719
728
- touch $crowbar_install_dir / initial_chef_client
720
+ set_step " initial_chef_client"
729
721
730
722
731
723
# Barclamp installation
@@ -780,7 +772,7 @@ if test -d $BARCLAMP_SRC/hyperv; then
780
772
/opt/dell/bin/barclamp_install.rb $BARCLAMP_INSTALL_OPTS hyperv
781
773
fi
782
774
783
- touch $crowbar_install_dir / barclamp_install
775
+ set_step " barclamp_install"
784
776
785
777
# First step of crowbar bootstrap
786
778
# -------------------------------
@@ -810,7 +802,7 @@ $chef_client
810
802
# OOC, what, if anything, is responsible for starting rainbows/crowbar under bluepill?
811
803
ensure_service_running crowbar
812
804
813
- touch $crowbar_install_dir / bootstrap_crowbar_setup
805
+ set_step " bootstrap_crowbar_setup"
814
806
815
807
816
808
# Second step of crowbar bootstrap
@@ -1054,7 +1046,7 @@ done
1054
1046
1055
1047
# BMC support?
1056
1048
1057
- touch $crowbar_install_dir / apply_crowbar_config
1049
+ set_step " apply_crowbar_config"
1058
1050
1059
1051
1060
1052
# Third step of crowbar bootstrap
@@ -1094,7 +1086,7 @@ done
1094
1086
# OK, let looper_chef_client run normally now.
1095
1087
rm /var/run/crowbar/deploying
1096
1088
1097
- touch $crowbar_install_dir / transition_crowbar
1089
+ set_step " transition_crowbar"
1098
1090
1099
1091
1100
1092
# Starting more services
@@ -1106,7 +1098,7 @@ echo_summary "Starting chef-client"
1106
1098
chkconfig chef-client on
1107
1099
ensure_service_running chef-client
1108
1100
1109
- touch $crowbar_install_dir / chef_client_daemon
1101
+ set_step " chef_client_daemon"
1110
1102
1111
1103
1112
1104
# Final sanity checks
@@ -1135,7 +1127,7 @@ for s in dhcpd apache2 ; do
1135
1127
fi
1136
1128
done
1137
1129
1138
- touch $crowbar_install_dir / post_sanity_checks
1130
+ set_step " post_sanity_checks"
1139
1131
1140
1132
# We're done!
1141
1133
# -----------
0 commit comments