Re: [packer] Packer is not allowing me to enable Software collection packages in Centos-7 with Packer

14 views
Skip to first unread message
Message has been deleted

Rickard von Essen

unread,
Jul 17, 2020, 4:43:37 AM7/17/20
to packe...@googlegroups.com
And what's the output when you run that with Packer? 

On Thu, Jul 16, 2020, 22:47 Nandeep Mannava <mannava...@gmail.com> wrote:
I am trying to build a centos-7 AMI with a packer. I am installing and enabling software collections packages in the shell script
 
#!/bin/bash

set -e


sudo yum install -y centos-release-scl

sudo yum groupinstall "Development Tools" -y && sudo yum install -y devtoolset-8

sudo scl enable devtoolset-8 bash

echo "Checking enabled SCL's"
echo $X_SCLS
echo "changing to Redis Directory"
cd $LOSANT_DIR/redis-6.0.5
echo "verifying the SCL before the code compillation"
echo $X_SCLS

echo $X_SCLS  must show a list of enabled software collections. When I am running from packer I am getting an empty list.

Can someone please help me.

Thanks,
Nandeep. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/dbaca783-2a55-4a23-a7f2-e82384898c6do%40googlegroups.com.

Alvaro Miranda Aguilera

unread,
Jul 18, 2020, 2:39:21 AM7/18/20
to packe...@googlegroups.com
hi

the way you run the commands probably can re reviewed

when using sudo is just one command so

this command i think wont do what you want
sudo scl enable devtoolset-8 bash

but if you remove the sudo
scl enable devtoolset-8 bash

not sure will work, if i do a search it seems you should be using something like

source scl_source enable devtoolset-8
so check the documentation of devtoolset-8 how you are supposed to source the environment from a script

you can try like this 

# installing
sudo yum install -y centos-release-scl
sudo yum groupinstall "Development Tools" -y && sudo yum install -y devtoolset-8

# checking 1

scl enable devtoolset-8 bash
echo "Checking enabled SCL's"
echo $X_SCLS
echo "changing to Redis Directory"
cd $LOSANT_DIR/redis-6.0.5
echo "verifying the SCL before the code compillation"
echo $X_SCLS


# checking 2
source scl_source enable devtoolset-8 bash
echo "Checking enabled SCL's"
echo $X_SCLS
echo "changing to Redis Directory"
cd $LOSANT_DIR/redis-6.0.5
echo "verifying the SCL before the code compillation"
echo $X_SCLS




alvaro


--
Alvaro

Reply all
Reply to author
Forward
0 new messages