Puppet hack: set the hiera_config

Puppet version(5.4.0) is higher than the version used in current StarlingX(4.8.2)
5.4.0 assume the default hiera_config is located at /etc/puppetlabs/puppet/hiera.yaml
4.8.2 assume the default hiera_config is located at /etc/puppet/hiera.yaml
So, ‘puppet apply’ cannot find the this hiera_config and then cannot find the hieradata files located in /tmp/puppet/hieradata/
This way, lots of variables defined in the hieradata cannot be found and this will fail puppet apply surely.
This commit is contained in:
Sar Ashki, Babak 2019-12-05 15:15:47 -08:00
parent 429af36288
commit bbf3aeb970

View File

@ -35,8 +35,9 @@ stx_postprocess_rootfs() {
CPWD=$(pwd)
cd ${IMAGE_ROOTFS}/etc/rc.d/init.d
for srv in $(echo hbsAgent runservices mtclog mtcalarm mtcClient \
for srv in $(echo hbsAgent hbsClient runservices mtclog mtcalarm mtcClient \
pmon hwmon hostw lmon guestAgent guestServer fm-api \
drbd \
)
do
rm -f $srv
@ -55,6 +56,8 @@ stx_postprocess_rootfs() {
mkdir -p ${IMAGE_ROOTFS}/opt/etcd
chown etcd:etcd ${IMAGE_ROOTFS}/opt/etcd
# Puppet hacks
sed -i -e 's:puppet apply : puppet apply --hiera_config=/etc/puppet/hiera.yaml :g' ${IMAGE_ROOTFS}/usr/bin/puppet-manifest-apply.sh
# Fake being redhat for dev purpose only. This must be removed
cat > ${IMAGE_ROOTFS}/etc/redhat-release << \EOF
CentOS Linux release 7.3.1611 (Core)