File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141# ################
4242# chef settings #
4343# ################
44- node_name=" deis-controller-$( tr -dc A-Za-z0-9 < /dev/urandom | head -c 5 | xargs) "
44+ node_name=" deis-controller-$( LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c 5 | xargs) "
4545run_list=" recipe[deis::controller]"
4646chef_version=11.6.2
4747
48+ if [ $node_name = ' deis-controller-' ]; then
49+ echo " Couldn't generate unique name for deis-controller. Aborting."
50+ exit 1
51+ fi
52+
4853# ########################
4954# digitalocean settings #
5055# ########################
@@ -124,11 +129,11 @@ if [ $result -ne 0 ]; then
124129 knife digital_ocean droplet destroy -S $droplet_id
125130 # Remove node and client from Chef Server
126131 echo_color " Deleting Chef client..."
127- knife client delete deis-controller -y
132+ knife client delete $node_name -y
128133 echo_color " Deleting Chef node..."
129- knife node delete deis-controller -y
134+ knife node delete $node_name -y
130135else
131136 echo_color " Knife bootstrap successful."
132137 # Need Chef admin permission in order to add and remove nodes and clients
133- echo -e " \033[35mPlease ensure that \" deis-controller \" is added to the Chef \" admins\" group.\033[0m"
138+ echo -e " \033[35mPlease ensure that \" $node_name \" is added to the Chef \" admins\" group.\033[0m"
134139fi
You can’t perform that action at this time.
0 commit comments