Jeff Schroeder wrote:
On Thu, Jan 29, 2009 at 11:44 AM, Michael DeHaan
<mdehaan(a)redhat.com> wrote:
...snip...
>> +# Loop until the ssh rpm is installed
>> +if [ "$keys_found" = "yes" ]; then
>> + while : ; do
>> + sleep 10
>> + if [ -d /mnt/sysimage/etc/ssh ] ; then
>> + cp -f /tmp/ssh/ssh_host* /mnt/sysimage/etc/ssh/
>> + logger "SSH-HOST-KEY copied to newly installed system"
>> + break
>> + fi
>> + done &
>> +fi
>> +#end
>>
>>
> Could the looping be eliminated by doing the top part in %pre and the later
> in %post?
>
> ex:
>
> %pre
> $SNIPPET('preserve_ssh_host_keys_pre')
>
> %post
> SNIPPET('preserve_ssh_host_keys_post')
>
Splitting this up requires "%post nochroot" because /mnt/sysimage
isn't available until after %pre. I am of the opinion "%post nochroot"
is more hacky than the alternative and chose not to do it this way on
purpose. What do you think is better given the options? It also seems
overly complicated to require %pre and %post sections when it can all
be done in %pre.
I think looping in Anaconda is kind of scary and wasn't really clear
that pre could loop infinitely.
Also folks putting code below the loop might be suprised to see it
delays things. (In fact, I wasn't clear
%packages didn't wait for all pre sections to complete? Maybe I'm
skimming this too fast).
Waiting until after the packages are installed (%post) seems quite sane,
and Anaconda does
support multiple %post sections. We could call the snippet
preserve_ssh_host_keys_post_nochroot if needed :)
On the other hand I'm all for splitting this up if it is the
difference between being included in upstream cobbler or not.
Yeah let's do this.
> I'd also encourage everyone else who has neat kickstart tricks to contribute
> them. I like the idea of packaging more with Cobbler rather than just
> keeping them on the Wiki.
>
Cool, more to come as I dream up ideas that aren't company-specific.
Outstanding. We'll make sure these are on the Wiki too, but we won't
have to link the code if they are already in the package.
Bridging the gap between Cobbler and clever tricks found on places like
kickstart-list is definitely goodness; it saves folks from having
to figure out how to do those tricks and makes for a great library for
folks to browse them.
--Michael