Add improved SSH/Fuel web instructions

- List all the IP address on which Fuel UI is
  accessible instead of only eth0.
- Also added default username and password
  for Fuel UI, hardcoded as admin/admin
- Removes duplicate code from
  bootstrap_admin_node scripts which was
  previously causing the sed line to
  appear twice in /etc/rc.local

Closes-Bug: #1351937

Change-Id: Ib0605c298c6ef26e8cdceb07171b76cee96ae3f8
This commit is contained in:
Sam Stoelinga 2014-08-13 22:02:20 +08:00
parent 9f327045cd
commit d737559bb7
3 changed files with 34 additions and 11 deletions

View File

@ -45,10 +45,7 @@ fi
#Reread /etc/sysconfig/network to inform puppet of changes
. /etc/sysconfig/network
hostname "$HOSTNAME"
#Update motd for IP
primary="$(grep "interface:" /etc/fuel/astute.yaml | cut -d':' -f2 | tr -d ' ')"
echo "sed -i \"s%\(^.*able on:\).*$%\1 http://\`ip address show $primary | awk '/inet / {print \$2}' | cut -d/ -f1 -\`:8000%\" /etc/issue" >>/etc/rc.local
sed -i "s%\(^.*able on:\).*$%\1 http://`ip address show $primary | awk '/inet / {print \$2}' | cut -d/ -f1 -`:8000%" /etc/issue
# ruby21-hiera RPM does not include /var/lib/hiera/ directory which may cause errors
### docker stuff
@ -81,5 +78,5 @@ puppet apply -d -v /etc/puppet/modules/nailgun/examples/host-only.pp
rmdir /var/log/remote && ln -s /var/log/docker-logs/remote /var/log/remote
dockerctl check
bash /etc/rc.local
echo "Fuel node deployment complete!"

View File

@ -42,14 +42,12 @@ fi
#Reread /etc/sysconfig/network to inform puppet of changes
. /etc/sysconfig/network
hostname "$HOSTNAME"
#Update motd for IP
primary="$(grep "interface:" /etc/fuel/astute.yaml | cut -d':' -f2 | tr -d ' ')"
echo "sed -i \"s%\(^.*able on:\).*$%\1 http://\`ip address show $primary | awk '/inet / {print \$2}' | cut -d/ -f1 -\`:8000%\" /etc/issue" >>/etc/rc.local
sed -i "s%\(^.*able on:\).*$%\1 http://`ip address show $primary | awk '/inet / {print \$2}' | cut -d/ -f1 -`:8000%" /etc/issue
# ruby21-hiera RPM does not include /var/lib/hiera/ directory which may cause errors
[ -d /var/lib/hiera ] || mkdir -p /var/lib/hiera
touch /var/lib/hiera/common.yaml /etc/puppet/hiera.yaml
# LANG variable is a workaround for puppet-3.4.2 bug. See LP#1312758 for details
puppet apply /etc/puppet/modules/nailgun/examples/site.pp
bash /etc/rc.local
echo "Fuel node deployment complete!"

View File

@ -458,16 +458,44 @@ cat > /etc/issue << EOF
#########################################
Server is running on \m platform
Fuel UI is available on: http://:8000
Fuel UI is available on:
http://:8000
Default administrator login: root
Default administrator password: r00tme
Default Fuel UI login: admin
Default Fuel UI password: admin
Please change root password on first login.
EOF
echo "sed -i \"s%\(^.*able on:\).*$%\1 http://\`ip address show eth0 | awk '/inet / {print \$2}' | cut -d/ -f1 -\`:8000%\" /etc/issue" >>/etc/rc.local
cat >> '/etc/rc.local' << EOF
first=yes
for ip in \$(ip -o -4 addr | grep "eth." | awk '{print \$4 }' | cut -d/ -f1); do
if [ "\$first" = "yes" ]; then
ipstr="Fuel UI is available on: http://\$ip:8000"
first=no
else
ipstr=\$(printf "%s\n%51s" "\$ipstr" "http://\$ip:8000")
fi
done
tmpissue=\$(mktemp)
while read -r line; do
if [[ "\$line" =~ "Fuel UI is available on" ]]; then
echo -e "\$ipstr" >> \$tmpissue
elif [[ "\$line" =~ :8000$ ]]; then
:
else
echo -e "\$line" >> \$tmpissue
fi
done < /etc/issue
mv "\$tmpissue" /etc/issue
EOF
# Unmounting source
umount -f ${SOURCE}