File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,16 +30,18 @@ api_key=${DIGITALOCEAN_API_KEY:-$(knife exec -E"puts Chef::Config[:knife][:digit
3030# Check that client ID and API key was set
3131if test -z $client_id ; then
3232 echo " Please add your Digital Ocean Client ID to the shell's environment or knife.rb."
33+ exit 1
3334fi
3435
3536if test -z $api_key ; then
3637 echo " Please add your Digital Ocean API Key to the shell's environment or knife.rb."
38+ exit 1
3739fi
3840
3941# ################
4042# chef settings #
4143# ################
42- node_name=deis-controller
44+ node_name=" deis-controller- $( tr -dc A-Za-z0-9 < /dev/urandom | head -c 5 | xargs ) "
4345run_list=" recipe[deis::controller]"
4446chef_version=11.6.2
4547
@@ -117,7 +119,7 @@ set +x
117119if [ $result -ne 0 ]; then
118120 echo_color " Knife botstrap failed."
119121 # Destroy droplet
120- droplet_id=$( knife digital_ocean droplet list | grep deis-controller | awk ' {print $1}' )
122+ droplet_id=$( knife digital_ocean droplet list | grep $node_name | awk ' {print $1}' )
121123 echo_color " Destroying Droplet $droplet_id ..."
122124 knife digital_ocean droplet destroy -S $droplet_id
123125 # Remove node and client from Chef Server
130132 # Need Chef admin permission in order to add and remove nodes and clients
131133 echo -e " \033[35mPlease ensure that \" deis-controller\" is added to the Chef \" admins\" group.\033[0m"
132134fi
133-
You can’t perform that action at this time.
0 commit comments