Added logic for conditional reboot of CentOS instances.