Template variables confusion

Hi

I am just trying to make sense of the @static variable for a kickstart
installation

According to the Wiki the @static and @dynamic Variables are both for the
partition tables

@static
true if the partition table being used is static <% if @static -%>
@dynamic
true if the parition table being used is a %pre script (has #Dynamic as
the first line of the table) <% if @dynamic -%>

But in the provided Kickstart template the @static variable ist used in the
network config

network --bootproto <%= @static ? "static" : "dhcp" %> --hostname <%=
@host %>

In the Provision_KVM_VM_without_DHCP WIKI page, the static parameter is
provides as an URL parameter

http://foremanserver.tld/unattended/provision?static=yes

The Question is now what is the correct use of the @static variable and is
possible to assign custom variable names as an URL parameter and refer to
it as @parametername in the template?

Cheers Markus

Hi Markus,

> Hi
>
> I am just trying to make sense of the @static variable for a kickstart
> installation
>
> According to the Wiki the @static and @dynamic Variables are both for the
> partition tables

You are right, this is a mistake, I've removed it from the examples.

>
> @static
> true if the partition table being used is static <% if @static -%>
> @dynamic
> true if the parition table being used is a %pre script (has #Dynamic as
> the first line of the table) <% if @dynamic -%>
>
> But in the provided Kickstart template the @static variable ist used in the
> network config
>
> network --bootproto <%= @static ? "static" : "dhcp" %> --hostname <%=
> @host %>
>
> In the Provision_KVM_VM_without_DHCP WIKI page, the static parameter is
> provides as an URL parameter
>
>
> http://foremanserver.tld/unattended/provision?static=yes
>
>
> The Question is now what is the correct use of the @static variable and is
> possible to assign custom variable names as an URL parameter and refer to it
> as @parametername in the template?
>

Static is used for gpxe based provisioning, where we already have the
network attributes as variables (in gpxe) for example see [1]

In 0.5, one can enter those attributes (gateway network etc) within
the subnet definition and use them within the provisioning template
(as @host.subnet.gateway).

Hope this helps,
Ohad

[1] - https://github.com/theforeman/foreman/blob/0.4-stable/app/views/unattended/gpxe_kickstart_config.erb#L2

ยทยทยท On Fri, Feb 24, 2012 at 6:02 PM, Markus wrote:

Hi Ohad

Thanks a lot for the clarification and the cleanup in the documentation.

Cheers
Markus