Is there a way that using kickstart I can tell it once its done install to go right ahead and do a "yum update"
Thanks,
Jerry
Jerry Geis wrote:
Is there a way that using kickstart I can tell it once its done install to go right ahead and do a "yum update"
Thanks,
Jerry
Ok I found a %post section in kickstart but is it valid to put a "yum -y update" there?
Thanks,
jerry
Ok I found a %post section in kickstart but is it valid to put a "yum -y update" there?
I usually call a post processing script that among other things does a "yum -y update" from the %post section (mounted via NFS), so calling yum directly from the %post should work.
Alfred
Ok I found a %post section in kickstart but is it valid to put a "yum -y update" there?
---------------- %post export PATH=/usr/bin:$PATH
echo "Yum Update" yum -y update yum yum -y update yum clean all -----------------
I did make a %post section in my file, added the "yum -y update" (got a machine to try it on)
and looks like a couple things happened:
1) It could not find the mirror. Even though I'm running DHCP I would not resolve a name after switching to one of the character consoles.
2) root is still /mnt/sysimage. Do I need to change that by running chroot /mnt/sysimage before running the yum -y update
THanks, for the suggestions.
Jerry
Jerry Geis wrote:
- It could not find the mirror. Even though I'm running DHCP I would
not resolve a name after switching to one of the character consoles.
I've read in the kickstart docs for RHEL5 that if your using DHCP name resolution won't work in %post. But in my experience it works fine, not sure why. I don't use yum in %post but I run many commands that require name resolution and they all succeed(when my systems come up initially after kickstarting they email me their system config and kickstart logs to verify it all worked fine). One thing to note, all of the things I download in %post are internal host names. It could be that for some bizarre reason only internet domain names don't work in %post.
One workaround may be to specify all IPs in your yum configuration, or put in /etc/host file entries, or manually assign name servers by echo'ing them to resolv.conf before running yum commands. I haven't tried any of these myself but in theory any of them should do the trick.
- root is still /mnt/sysimage. Do I need to change that by running
chroot /mnt/sysimage before running the yum -y update
things run in %post are automatically put into a chroot so that root is /.
At least it is for me in RHEL4/5 and CentOS 4/5/5.1 performing either a PXE kickstart or kickstart off a CD(with everything else retrieved from the network).
nate
On Sat, 2 Feb 2008, nate wrote:
I've read in the kickstart docs for RHEL5 that if your using DHCP name resolution won't work in %post. But in my experience it works fine, not sure why.
It works fine _if_ your DHCP server also supplies the IP address(es) of your name servers.
Steve
Add this to the end of your kickstart file: ===================== %post
yum -y update =====================
In fact, you can do all sorts of things, like configure services using chkconfig. You have a bash interpreter and your chrooted into your new install.
I used to do all sorts of crazy stuff in there, until I found puppet :) Now I have minimal kickstart configs and I let puppet do all the heavy lifting.
On Feb 2, 2008 8:48 AM, Jerry Geis geisj@pagestation.com wrote:
Is there a way that using kickstart I can tell it once its done install to go right ahead and do a "yum update"
Thanks,
Jerry
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Feb 3, 2008 12:41 AM, Gary Richardson gary.richardson@gmail.com wrote:
Add this to the end of your kickstart file:
%post
yum -y update
In fact, you can do all sorts of things, like configure services using chkconfig. You have a bash interpreter and your chrooted into your new install.
I used to do all sorts of crazy stuff in there, until I found puppet :) Now I have minimal kickstart configs and I let puppet do all the heavy lifting.
And how do you get kickstart to start puppet? Do you need to add stuff in %post or is it enough to just install the packages?
We are investigating doing just that - kickstart a CentOS Xen guest and get it to pull as much configuration as possible through puppet.
Any other hints anyone can give about using Puppet on CentOS would be appreciated.
Thanks.
--Amos
Amos Shapira wrote:
And how do you get kickstart to start puppet? Do you need to add stuff in %post or is it enough to just install the packages?
I don't use puppet, but use cfengine, they perform similar tasks. I install the packages and base configuration for cfengine in %post and then when the system boots it sync's up (I still perform manual hostname and static IP addressing after the system boots, and cfengine pushes the config to the system based on the host name).
%post (
cat <<EOF; ############################################################################### ## CFEngine Install ## ############################################################################### EOF
rpm -Uvh http://kickstart.sea2.my.domain/updates/rhel_5_32/cfengine/cfengine-2.1.22-1... wget http://kickstart.sea2.my.domain/kickstart/post-installs/common/cfengine/cfag... -O /var/cfengine/inputs/cfagent.conf wget http://kickstart.sea2.my.domain/kickstart/post-installs/common/cfengine/upda... -O /var/cfengine/inputs/update.conf wget http://kickstart.sea2.my.domain/kickstart/post-installs/common/cfengine/root... -O /var/cfengine/ppkeys/root-10.200.1.39.pub wget http://kickstart.sea2.my.domain/kickstart/post-installs/common/cfengine/root... -O /var/cfengine/ppkeys/root-10.10.20.44.pub chown root.root /var/cfengine/inputs/cfagent.conf /var/cfengine/inputs/update.conf /var/cfengine/ppkeys/* chmod 664 /var/cfengine/inputs/cfagent.conf /var/cfengine/inputs/update.conf /var/cfengine/ppkeys/* [..] (lots more %post stuff) - setup network teaming - disable grub splash screen - disable IPv6 - clean up /etc/hosts (dhcp client pollutes it) - setup auto email notification upon initial boot - explicity turn on/off certain services - update to latest internally tested kernel ("manually", not via yum) - update to latest internally tested RPMs ("manually", not via yum)
My co-worker looked at puppet last year for a time and was excited about it for a while but lost interest. Don't recall what he didn't like I think just the thought of migrating existing cfengine configs to puppet didn't make the migration worthwhile to him. I hear it's the "future" though.
Once the system has a host name cfengine gives it a ton more configuration.
nate