On Fri, Aug 3, 2012 at 9:12 AM, Eldred, Doug <[email protected]> wrote:
>> Updated the Advanced Power topic on the manual:
>
>> http://cobbler.github.com/manuals/2.2.3/5/6_-_Power_Management.html
>
>> Let me know if that looks ok, or if you find any mistakes.
>
> The documentation itself seems fairly good at a quick read. However, this
> still seems to lose the pre-2.2.3 flexibility of providing arbitrary values
> on a per-system basis, whether via the power_id field or in some other
> new/better way.
>
> First, though I might be missing something, I don't see a template way to
> parse the old power_id string "-P -T 4" into "lanplus" and "power_wait=4",
> since $power_id is a single variable.
>
> Second, if you hard-code such values in a template, what happens if different
> systems need different values? We have one old box with an iLO2 which
> requires a timeout change, but applying that change to ALL our boxes with
> iLO2 causes THEM to have problems. In the case where only ONE value is
> variable I guess we can customize using power_id, but unless the previous
> item is wrong I don't see a way to have per-system values in general.
>
> Third, again unless I'm missing something the answer isn't to have
> "power_system1" and "power_system2" and ... and "power_systemN" since the
> command is also based on the power_type, and there's no
> /usr/sbin/fence_system1, /usr/sbin/fence_system2, etc. mapping.
You can accomplish the same task by using ksmeta variables, and
writing your template to use them. You could do something like:
$ cobbler system edit --name=foo --ksmeta="power_special_type=two"
Then in your template:
#set $power_special_type = $getVar("power_special_type","one") # type
'one' is the default
#if $power_special_type=="two"
lanplus
power_wait=4
#else
lanplus
#end if
I acknowledge this is more involved, but it is also infinitely safer
than allowing shell injection (which is really what you were doing
above).
I would be willing to accept a feature request to add a new field
along the lines of --power-extra-options, which would be fed into the
default template and could potentially eliminate the need for power
templates at all. Feel free to open it on the github site.
_______________________________________________
cobbler mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/cobbler