6 for ((i=$1-1; i>=1; i--)); do
13 echo "ERROR: Fuel node deployment FAILED! Check /var/log/puppet/bootstrap_admin_node.log for details" 1>&2
16 # LANG variable is a workaround for puppet-3.4.2 bug. See LP#1312758 for details
17 export LANG=en_US.UTF8
19 if [ -f /root/.showfuelmenu ]; then
23 echo -n "Applying default Fuel settings..."
24 fuelmenu --save-only --iface=eth0
27 if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then
30 #Give user 15 seconds to enter fuelmenu or else continue
32 echo -n "Press a key to enter Fuel Setup (or press ESC to skip)... 15"
34 if ! read -s -n 1 -t 15 key; then
35 echo -e "\nSkipping Fuel Setup..."
37 { kill "$pid"; wait $!; } 2>/dev/null
39 $'\e') echo "Skipping Fuel Setup.."
40 echo -n "Applying default Fuel setings..."
41 fuelmenu --save-only --iface=eth0
44 *) echo -e "\nEntering Fuel Setup..."
50 #Reread /etc/sysconfig/network to inform puppet of changes
51 . /etc/sysconfig/network
55 images_dir="/var/www/nailgun/docker/images"
57 # extract docker images
58 mkdir -p $images_dir $sources_dir
59 rm -f $images_dir/*tar
60 pushd $images_dir &>/dev/null
62 echo "Extracting and loading docker images. (This may take a while)"
63 lrzip -d -o fuel-images.tar fuel-images.tar.lrz && tar -xf fuel-images.tar && rm -f fuel-images.tar
68 for image in $images_dir/*tar ; do
69 echo "Loading docker image ${image}..."
70 docker load -i "$image"
71 # clean up extracted image
76 puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/host-only.pp
80 rmdir /var/log/remote && ln -s /var/log/docker-logs/remote /var/log/remote
82 dockerctl check || fail
84 echo "Fuel node deployment complete!"