[Spacewalk-list] Variables not passing to snippets
Michael Mraka
michael.mraka at redhat.com
Wed Feb 9 14:38:11 UTC 2011
Hagberg, Keith wrote:
% What determines when you need raw mode.
Basically *all* $ signs have to be escaped otherwise python-cheetah (the
templating machine used by cobbler) gets mad and won't render the
snippet.
% If I remove #raw and #end raw the snippet does not get put into the
% kickstart. When the kickstart is created it still has the snippet
% name in it.
%
% I tried to escape the $ETH variable and it still will not replace it.
%
% Here is my snippet
%
% #raw
% SPEED=`ethtool $ETH | grep Speed | cut -d' ' -f2`
% if [ "$SPEED" == "1000Mb/s" ]; then
% echo NIC running at 1000mb/s
% echo "ETHTOOL_OPTS=\"speed 1000 duplex full autoneg on\"" >> /etc/sysconfig/network-scripts/ifcfg-$ETH
% echo "Resetting "$ETH
% ifup $DEV
% elif [ "$SPEED" == "100Mb/s" ]; then
% echo NIC running at 100mb/s
% echo "ETHTOOL_OPTS=\"speed 100 duplex full autoneg off\"" >> /etc/sysconfig/network-scripts/ifcfg-"$ETH"
% echo "Resetting "$ETH
% ifup $ETH
% else
% echo could not determine speed
% fi
% ethtool $ETH
% #end raw
----
SPEED=`ethtool \$ETH | grep Speed | cut -d' ' -f2`
if [ "\$SPEED" == "1000Mb/s" ]; then
echo NIC running at 1000mb/s
echo "ETHTOOL_OPTS=\"speed 1000 duplex full autoneg on\"" >> /etc/sysconfig/network-scripts/ifcfg-\$ETH
echo "Resetting "\$ETH
ifup \$DEV
elif [ "\$SPEED" == "100Mb/s" ]; then
echo NIC running at 100mb/s
echo "ETHTOOL_OPTS=\"speed 100 duplex full autoneg off\"" >> /etc/sysconfig/network-scripts/ifcfg-"\$ETH"
echo "Resetting "\$ETH
ifup \$ETH
else
echo could not determine speed
fi
ethtool \$ETH
---
Regards,
--
Michael Mráka
Satellite Engineering, Red Hat
More information about the Spacewalk-list
mailing list