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 ### OPNFV addition BEGIN
29 for script in /opt/opnfv/bootstrap/pre.d/*.sh
31 echo "Pre script: $script" >> /root/pre.log 2>&1
32 $script >> /root/pre.log 2>&1
35 ### OPNFV addition END
37 if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then
40 #Give user 15 seconds to enter fuelmenu or else continue
42 echo -n "Press a key to enter Fuel Setup (or press ESC to skip)... 15"
44 if ! read -s -n 1 -t 15 key; then
45 echo -e "\nSkipping Fuel Setup..."
47 { kill "$pid"; wait $!; } 2>/dev/null
49 $'\e') echo "Skipping Fuel Setup.."
50 echo -n "Applying default Fuel setings..."
51 fuelmenu --save-only --iface=eth0
54 *) echo -e "\nEntering Fuel Setup..."
60 #Reread /etc/sysconfig/network to inform puppet of changes
61 . /etc/sysconfig/network
65 images_dir="/var/www/nailgun/docker/images"
67 # extract docker images
68 mkdir -p $images_dir $sources_dir
69 rm -f $images_dir/*tar
70 pushd $images_dir &>/dev/null
72 echo "Extracting and loading docker images. (This may take a while)"
73 lrzip -d -o fuel-images.tar fuel-images.tar.lrz && tar -xf fuel-images.tar && rm -f fuel-images.tar
78 for image in $images_dir/*tar ; do
79 echo "Loading docker image ${image}..."
80 docker load -i "$image"
81 # clean up extracted image
86 puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/host-only.pp
90 rmdir /var/log/remote && ln -s /var/log/docker-logs/remote /var/log/remote
92 dockerctl check || fail
95 ### OPNFV addition BEGIN
97 for script in /opt/opnfv/bootstrap/post.d/*.sh
99 echo "Post script: $script" >> /root/post.log 2>&1
100 $script >> /root/post.log 2>&1
103 ### OPNFV addition END
105 echo "Fuel node deployment complete!"