Everything you're trying to do should be handled by the default snippets,
you should not need to modify them.
For future reference though, when you see an un-rendered $SNIPPET in your
final output it means you've got a template error, which can usually be
diagnosed by looking at /var/log/cobbler/cobbler.log for an error message,
something like this:
Sun May 26 23:41:18 2013 - WARNING |
[{'code': u'VFFSL(SL,"SNIPPET",False)(\'hosts.xml\')',
'exc_val': NotFound(u"cannot find 'interfaces'",),
'lineCol': (28, 3),
'rawCode': u"$SNIPPET('hosts.xml')",
'time': 'Sun May 26 23:41:18 2013'},
{'code': u'VFFSL(SL,"SNIPPET",False)(\'networking.xml\')',
'exc_val': NotFound(u"cannot find 'hostname'",),
'lineCol': (38, 3),
'rawCode': u"$SNIPPET('networking.xml')",
'time': 'Sun May 26 23:41:18 2013'}]
(the above is from me troubleshooting why opensuse builds no longer seem to
be working...)
On Mon, May 27, 2013 at 8:20 AM, Rainer Duffner <[email protected]>wrote:
> Am Mon, 27 May 2013 06:27:28 -0500
> schrieb James Cammarata <[email protected]>:
>
> > All snippets are python-cheetah templates, so what appears to be
> > commented-out python is actually the cheetah templating language.
> >
> > The post_install_network_config_deb script is used inside the
> > /var/lib/cobbler/scripts/preseed_late_default script, which is called
> > as the late_command in the sample.seed:
> >
> > d-i preseed/late_command string wget -O- \
> > http://
> $http_server/cblr/svc/op/script/$what/$name/?script=preseed_late_default
> > | \
> > chroot /target /bin/sh -s
> >
> > Where $what is either "system" or "profile".
> >
> > To set the gateway in ubuntu, use:
> >
> > $ cobbler system edit --name=foo --interface=ethX --if-gateway=1.2.3.4
>
>
>
>
> OK, so I have:
>
>
> [root@cobbler ~]# tail -n 5 \
> /var/lib/cobbler/kickstarts/u12-noncore2.seed
> # packages and run commands in the target system.
> # d-i preseed/late_command string [command]
> d-i preseed/late_command string wget -O- \
> http://
> $http_server/cblr/svc/op/script/$what/$name/?script=preseed_late_default2
> | \ chroot /target /bin/sh -s
>
>
> When I run that line on the shell, I get:
>
>
> # Start preseed_late_default
> # This script runs in the chroot /target by default
> $SNIPPET('post_install_network_config2_deb')
> # start late_apt_repo_config
> cat<<EOF>/etc/apt/sources.list
> deb http://cobbler-server-ip/cblr/links/Ubuntu12-x86_64 precise main
> EOF
> # end late_apt_repo_config
>
> # A general purpose snippet to add late-command actions for preseeds
>
> # Start download cobbler managed config files (if applicable)
> # End download cobbler managed config files (if applicable)
>
> wget "http://cobbler-server-ip/cblr/svc/op/ks/system/test-ubuntu" \
> -O /var/log/cobbler.seed
> wget \
> "http://cobbler-server-ip/cblr/svc/op/trig/mode/post/system/test-ubuntu"
> -O /dev/null # End preseed_late_default
>
>
> When I run that, I get the 4-byte file with "True" in it.
>
> No error-message in /var/log/cobbler/cobbler.log
>
>
> > Note from above, your variable $ksgw would not be stored in $idata
> > (which is the interface data for the system), rather you would put it
> > in --ksmeta and then get the variable with just:
> >
> > #set $ksgw = $getVar("ksgw","")
>
>
> Thanks, I was looking for something like this.
>
> Unfortunately, it did not help.
>
> How can I debug this?
> _______________________________________________
> cobbler mailing list
> [email protected]
> https://lists.fedorahosted.org/mailman/listinfo/cobbler
>
_______________________________________________
cobbler mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/cobbler