3 # A heat-config-script which runs yum update during a stack-update.
5 # deploy_action - yum will only be run if this is UPDATE
6 # update_identifier - yum will only run for previously unused values of update_identifier
7 # command - yum sub-command to run, defaults to "update"
8 # command_arguments - yum command arguments, defaults to ""
10 echo "Started yum_update.sh on server $deploy_server_id at `date`"
12 if [[ -z "$update_identifier" ]]; then
13 echo "Not running due to unset update_identifier"
17 timestamp_dir=/var/lib/overcloud-yum-update
18 mkdir -p $timestamp_dir
20 # sanitise to remove unusual characters
21 update_identifier=${update_identifier//[^a-zA-Z0-9-_]/}
23 timestamp_file="$timestamp_dir/$update_identifier"
24 if [[ -a "$timestamp_file" ]]; then
25 echo "Not running for already-run timestamp \"$update_identifier\""
28 touch "$timestamp_file"
30 command=${command:-update}
31 full_command="yum -y $command $command_arguments"
32 echo "Running: $full_command"
34 result=$($full_command)
37 echo "yum return code: $return_code"
39 echo "Finished yum_update.sh on server $deploy_server_id at `date`"