On 09/13/2013 01:24 PM, Leonid Flaks wrote:
I think you hit the scoping issue here - backupIP is defined inside of
a snippet network_funk, but you use it outside of it.
One of the things to try would be set it as a global variable:
#set global backupIP='10.10.32.45'
This solved my problem. Thanks.
If I'm doing something like (consider this pseudoishcode):
#set ikeys= $interfaces.keys()
#for $iname in $ikeys
#set something = $interfaces[$iname]
#if $something is $interesting:
#set $real_necessary=$thing
Would it be best to just include that via $SNIPPET() once at the top
level of the ks, and then all the snippets included below it will get
the benefit?
(I've only been playing with this part of cobbler for a day or two).
Regards,
Petro.
:wq
Hope that helps,
Leon
On 09/13/2013 03:16 PM, Petro wrote:
I've got a moderately complicated network environment where I need to do
some IP/hostname manipulations within my client's kickstart script. This
has to be used in several snippets, so I'd like to be able the same
block of code in several places.
This is, in theory, achievable by doing a $SNIPPET('network_funk')
inside of the "backup_setup" snippet.
So for simplicity sake we'd have network_funk be:
#set backupIP='10.10.32.45'
and backup_setup be:
$SNIPPET('network_funk')
cat /etc/backupConfigFIle << EOF
MyBackupHost=$backupIP
EOF
so then in myInstaller.ks I would:
%post
$SNIPPET('backup_setup')
However when I do something very much like this, I get
"$SNIPPET('backup_setup') in my ks config delivered via the webserver.
What am I missing here?
_______________________________________________
cobbler mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/cobbler