[et-mgmt-tools] Looping through possibilities in a "snippet"
Michael DeHaan
mdehaan at redhat.com
Mon Apr 14 14:48:24 UTC 2008
Sandor W. Sklar wrote:
>
> On Apr 11, 2008, at 1:05 PM, Michael DeHaan wrote:
>>
>> I've implemented this here -- with only a slight change to the way
>> the above behavior works (basically there are no distro-overrides
>> and the paths are slightly different):
>>
>> https://fedorahosted.org/cobbler/wiki/KickstartSnippets
>>
>> It's under the "Advanced Snippets" section and is available now in
>> the git/devel branch. Testing welcome!
>
> I've tested this out with a fairly simple contrived example, and it
> worked perfectly. I created the following files and directories:
>
> # find /var/lib/cobbler/snippets -type f
> /var/lib/cobbler/snippets/packages
> /var/lib/cobbler/snippets/post
> /var/lib/cobbler/snippets/pre
> /var/lib/cobbler/snippets/per_profile/packages/testprofile
> /var/lib/cobbler/snippets/per_profile/post/testprofile
> /var/lib/cobbler/snippets/per_profile/pre/testprofile
I like the idea of the pre/post sections being subbed out. I didn't
think of that :)
>
>
> I created this profile:
>
> # cobbler profile report --name=testprofile
> profile : testprofile
> parent : rhel5Server-x86_64
> kickstart : /etc/cobbler/foo.ks
> (... snip ...)
>
> And then added two system records:
>
> # cobbler system add --name=system1 --ip=172.24.10.10
> --mac="00:16:3e:43:22:02" --profile=rhel5Server-x86_64
>
> # cobbler system add --name=system2 --ip=172.24.20.20
> --mac="00:16:3e:40:0a:a3" --profile=testprofile
>
> ... and ran "cobbler sync"; the rendered kickstarts in
> /var/www/cobbler/kickstarts_sys/{system1,system2}/ks.cfg contained
> exactly what I expected (system1's had the contents of
> snippets/{packages,post,pre}, and system2's had the contents of
> snippets/per_profile/{packages,post,pre}/testprofile.)
>
> This is a totally awesome improvement, and when the devel version is
> ready for prime-time, it is going to make a *huge* difference in the
> simplicity of our systems deployment.
>
> I've got a few comments about the testing process and some issues I
> ran into; these comments shouldn't be construed as criticism, as I
> expect most of those issues are of my own making or ignorance. That said:
>
> * I'd never used "git", nor installed it before. It took me a little
> bit to figure out how to get it onto an RHEL5 system, but once I set
> up the EPEL yum repo, it installed cleanly. The PatchProcess wiki page
> helped immensely in getting going, but I think it would be useful to
> have a "How to build a devel branch RPM on an RHEL5 system for
> dummies" page (I'd be happy to write it, unless y'all think this is
> something that shouldn't be in the wiki.)
That sounds great to me!
>
> * The last version of cobbler I built (from the src.rpm) was 0.8.2.
> Sometime between that version and the devel, a dependancy on the
> python-ldap module was added. The RPM built, but all cobbler actions
> failed with the traceback:
>
> ... (snip)
> File "/usr/lib/python2.4/site-packages/cobbler/modules/authn_ldap.py",
> line 20, in ?
> import ldap
> ImportError: No module named ldap
>
>
> Perhaps I just missed something that stated that requirement. It would
> be really nice, though, if those of us that have no use for the
> authentication parts (ldap, for one) could disable it, perhaps with a
> config variable like "use_ldap: 0".
I'll add some code to keep that from being imported until it's needed.
Thanks for the heads up. It won't require a config file setting.
>
> * This might be a known issue, but when I imported a distro ...
>
> # mount -o loop ./rhel-5.1-server-x86_64-dvd.iso /mnt
> # cobbler import --path=/mnt --name=rhel5Server-x86_64
>
> ... it ran fine, and then exited with the below traceback. The distro
> appeared to suffer no ill effect from this error, or, at least it
> worked for everything that I tested in this limited setup environment:
>
> NameError: global name 'utils' is not defined
>
I've been doing some reorganizing, I'll take a look at this and fix it
if it's still present.
>
> Like I said, this new improvement in snippet handling greatly benefits
> us, and I'm really excited to be able to deploy it, hopefully soon
> (I'll wait until its available in the "stable" branch ... our cobbler
> server has become too important for me to screw up! :-)
Stable 1.0 should be out in about a month. There will be a test source
rpm or two before then for people to test with and report bugs prior to
things going into production repos.
>
> Thanks again, Michael!
You're welcome!
>
> -s-
>
>
>
>
>
>
>
>
> _______________________________________________
> et-mgmt-tools mailing list
> et-mgmt-tools at redhat.com
> https://www.redhat.com/mailman/listinfo/et-mgmt-tools
More information about the et-mgmt-tools
mailing list