install-chef-server failes on CentOS 6.4 w/ redhat-lsb-core installed
Closed this issue · 5 comments
# rpm -qa | grep lsb
redhat-lsb-core-4.0-7.el6.centos.x86_64
# cat /etc/lsb-release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
# cat install-chef-server.sh | bash
+ export DEBIAN_FRONTEND=noninteractive
+ DEBIAN_FRONTEND=noninteractive
+ '[' -e /etc/lsb-release ']'
+ source /etc/lsb-release
++ LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
+ OS_TYPE=
bash: line 31: DISTRIB_RELEASE: unbound variable
I got a comment on the docs that might be related to this. Is this something we should handle with documentation, or is there another way we can work around this?
Just to pile on. During my ansible shanigans Friday, I had that script both work and explode on CentOS 6.4. Even when it exploded, knife still worked. boggle. @Apsu and/or I will be digging into this again, still, more.
So as of this mornings master, on CentOS 6.4, I get this when running the script while logged in as root:
*****
Configuration file written to /root/.chef/knife.rb
+ sed -i '/export PATH=${PATH}:\/opt\/chef-server\/bin/d' /root/.bash_profile
+ echo 'export PATH=${PATH}:/opt/chef-server/embedded/bin'
+ export OLDPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
+ OLDPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
+ export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
+ source /root/.bash_profile
++ '[' -f /root/.bashrc ']'
++ . /root/.bashrc
+++ alias 'rm=rm -i'
+++ alias 'cp=cp -i'
+++ alias 'mv=mv -i'
+++ '[' -f /etc/bashrc ']'
+++ . /etc/bashrc
/etc/bashrc: line 12: PS1: unbound variable
Nearly everything completes, chef and knife are installed and functioning.
Line 12 of /etc/bashrc is:
if [ "$PS1" ]; then
stop using set -u
in the script and do more explicit error checking
I am getting unbound variable errors because it doesn't look like the environment vars are getting pulled right. I'm looking into rewriting it now.