[Spacewalk-list] spacewalk cobbler issue

John Hodrien J.H.Hodrien at leeds.ac.uk
Mon Mar 1 09:40:46 UTC 2010


On Sun, 28 Feb 2010, Johnny Mirza wrote:

> Hi John,
>
> I was trying to put it in the pre section but I couldn't figure out how to
> do it, I would love to get a copy of your script to see how you have done
> it...

No problem.  Here's how I did it, piggybacking on the file preservation stuff:

===============

mkdir -p /tmp/ks-tree-shadow/etc/yum.repos.d/custom

cat << EOF > /tmp/ks-tree-shadow/etc/yum.conf
[main]
cachedir=/var/cache/yum
reposdir=/etc/yum.repos.d/custom/
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=centos-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

# Default.
# installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d/custom
EOF

> I have manage to resolve this issue with a probably non-recommended work
> around.  I have modified the redhat_register snippet in
> /var/lib/cobbler/snippets to add this line before the rhnreg_ks
>
> 	# Start
>  	sed -i '/^gpgcheck=.*$/aenabled=0' /etc/yum.repos.d/Cent*
>  	sed -i 'x; G; /^\(.*\)\n\1$/ d; g; p; d' /etc/yum.repos.d/Cent*
> 	[ -f "/etc/yum/pluginconf.d/rhnplugin.conf" ] && sed -i -e 's/^gpgcheck = 1$/gpgcheck = 0/g' 	/etc/yum/pluginconf.d/rhnplugin.conf
> 	# End

Cunning.

> Also in regards to the yum upgrade issue, we use puppet to manage our
> systems and I have added a class to ensure that CentOS mirrors are always
> disabled.
>
> If we could change the order of the post snippets then that would make
> things a lot cleaner.

Yep.  That was a mentioned as a possibility in the past.

jh




More information about the Spacewalk-list mailing list