Fix errors reported by shellcheck for Puppet
Change-Id: I8277c6265501c74d07493f723472fbf4b85ca29e
This commit is contained in:
parent
95d03fed86
commit
cff7080d2e
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
PUPPET_CODE=`echo -n $1 | base64 -d`
|
PUPPET_CODE=$(echo -n "$1" | base64 -d)
|
||||||
|
|
||||||
puppet apply --detailed-exitcodes --color=false --execute "${PUPPET_CODE}"
|
puppet apply --detailed-exitcodes --color=false --execute "${PUPPET_CODE}"
|
||||||
|
|
||||||
@ -11,4 +11,4 @@ if [ "${PUPPET_RETURN}" -eq 4 ] || [ "${PUPPET_RETURN}" -eq 6 ] ; then
|
|||||||
exit ${PUPPET_RETURN}
|
exit ${PUPPET_RETURN}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
KEY="$1"
|
KEY="$1"
|
||||||
|
|
||||||
hiera -c /etc/puppet/hiera.yaml $KEY
|
hiera -c /etc/puppet/hiera.yaml "$KEY"
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
module_name=$1
|
module_name=$1
|
||||||
|
|
||||||
sudo puppet module install ${module_name}
|
sudo puppet module install "${module_name}"
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
@ -39,7 +39,7 @@ function is_ubuntu {
|
|||||||
|
|
||||||
function is_opensuse {
|
function is_opensuse {
|
||||||
[ -f /usr/bin/zypper ] && \
|
[ -f /usr/bin/zypper ] && \
|
||||||
cat /etc/os-release | grep -q -e "openSUSE"
|
grep -q -e "openSUSE" < /etc/os-release
|
||||||
}
|
}
|
||||||
|
|
||||||
# dnf is a drop-in replacement for yum on Fedora>=22
|
# dnf is a drop-in replacement for yum on Fedora>=22
|
||||||
@ -145,17 +145,17 @@ function setup_puppet_ubuntu {
|
|||||||
--assume-yes install -y --force-yes lsb-release
|
--assume-yes install -y --force-yes lsb-release
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lsbdistcodename=`lsb_release -c -s`
|
lsbdistcodename=$(lsb_release -c -s)
|
||||||
if [ $lsbdistcodename != 'trusty' ] ; then
|
if [ "$lsbdistcodename" != 'trusty' ] ; then
|
||||||
rubypkg=rubygems
|
rubypkg=rubygems
|
||||||
else
|
else
|
||||||
rubypkg=ruby
|
rubypkg=ruby
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
PUPPET_VERSION=3.*
|
PUPPET_VERSION="3.*"
|
||||||
PUPPETDB_VERSION=2.*
|
PUPPETDB_VERSION="2.*"
|
||||||
FACTER_VERSION=2.*
|
FACTER_VERSION="2.*"
|
||||||
|
|
||||||
cat > /etc/apt/preferences.d/00-puppet.pref <<EOF
|
cat > /etc/apt/preferences.d/00-puppet.pref <<EOF
|
||||||
Package: puppet puppet-common puppetmaster puppetmaster-common puppetmaster-passenger
|
Package: puppet puppet-common puppetmaster puppetmaster-common puppetmaster-passenger
|
||||||
@ -172,9 +172,9 @@ Pin-Priority: 501
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
puppet_deb=puppetlabs-release-${lsbdistcodename}.deb
|
puppet_deb=puppetlabs-release-${lsbdistcodename}.deb
|
||||||
wget http://apt.puppetlabs.com/$puppet_deb -O $puppet_deb
|
wget "http://apt.puppetlabs.com/$puppet_deb" -O "$puppet_deb"
|
||||||
dpkg -i $puppet_deb
|
dpkg -i "$puppet_deb"
|
||||||
rm $puppet_deb
|
rm "$puppet_deb"
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \
|
DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \
|
||||||
@ -186,8 +186,9 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setup_puppet_opensuse {
|
function setup_puppet_opensuse {
|
||||||
local version=`grep -e "VERSION_ID" /etc/os-release | tr -d "\"" | cut -d "=" -f2`
|
local version=
|
||||||
zypper ar http://download.opensuse.org/repositories/systemsmanagement:/puppet/openSUSE_${version}/systemsmanagement:puppet.repo
|
version=$(grep -e "VERSION_ID" /etc/os-release | tr -d "\"" | cut -d "=" -f2)
|
||||||
|
zypper ar "http://download.opensuse.org/repositories/systemsmanagement:/puppet/openSUSE_${version}/systemsmanagement:puppet.repo"
|
||||||
zypper -v --gpg-auto-import-keys --no-gpg-checks -n ref
|
zypper -v --gpg-auto-import-keys --no-gpg-checks -n ref
|
||||||
zypper --non-interactive in --force-resolution puppet
|
zypper --non-interactive in --force-resolution puppet
|
||||||
# Wipe out templatedir so we don't get warnings about it
|
# Wipe out templatedir so we don't get warnings about it
|
||||||
@ -259,4 +260,4 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
@ -5,7 +5,7 @@ ENV_NAME="$1"
|
|||||||
PUPPETFILE_LINK="$2"
|
PUPPETFILE_LINK="$2"
|
||||||
ENV_DIR="/etc/puppet/environments/${ENV_NAME}"
|
ENV_DIR="/etc/puppet/environments/${ENV_NAME}"
|
||||||
|
|
||||||
cd ${ENV_DIR}
|
cd "${ENV_DIR}"
|
||||||
wget --quiet -c ${PUPPETFILE_LINK} -O Puppetfile
|
wget --quiet -c "${PUPPETFILE_LINK}" -O Puppetfile
|
||||||
|
|
||||||
librarian-puppet install
|
librarian-puppet install
|
||||||
|
Loading…
x
Reference in New Issue
Block a user