How do katello provisioning templates work?

I am trying to determine the relationship between katello kickstart
templates and katello provisioning templates.

It seems that a katello provisioning template gets called if chosen, even
if never directly referenced from the kickstart template. Is that true?

If so, how does katello know where to insert the provisioning template?
Does it just stick it automatically right after the end of the %pre section?

Some test of mine with a provisioning template selected seemed to show the
provisioning stuff getting inserted around there.

Also, I'm a little confused about this block of code in the default
kickstart file :

<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>

First, looking at
TemplateWriting - Foreman I
cannot find the @dynamic variable…
When does this get invoked?
What does that variable store?
What are the contents of @host.diskLayout? Is it a full set of actual
provisioning commands like "part swap --size=4096 --asprimary
–ondisk=sda" for example ?

Does this disklayout variable replace or augment the actual provisioning
commands that layout partitions?

And is that block of code actually required to provision at all and what
does it do? I've commented it out in test and the server still seem to get
their partitions setup properly.

Hello

> I am trying to determine the relationship between katello kickstart
> templates and katello provisioning templates.
>
> It seems that a katello provisioning template gets called if chosen, even
> if never directly referenced from the kickstart template. Is that true?
>
> If so, how does katello know where to insert the provisioning template?
> Does it just stick it automatically right after the end of the %pre section?
>
> Some test of mine with a provisioning template selected seemed to show the
> provisioning stuff getting inserted around there.
>

I don't think this is related to Katello, it's generic Foreman thing. In
general, provisioning template generates an url that is used to retrieve
kickstart template (foreman_url helper). This way kickstart template is
referenced.

> Also, I'm a little confused about this block of code in the default
> kickstart file :
>
> <% if @dynamic -%>
> %include /tmp/diskpart.cfg
> <% else -%>
> <%= @host.diskLayout %>
> <% end -%>
>
> First, looking at
> TemplateWriting - Foreman I
> cannot find the @dynamic variable…
> When does this get invoked?
> What does that variable store?
> What are the contents of @host.diskLayout? Is it a full set of actual
> provisioning commands like "part swap --size=4096 --asprimary
> --ondisk=sda" for example ?

It's internal thing, you can find it at


basically it checks if the layout starts with "#Dynamic" magic keyword. Please
see this page for more details
http://projects.theforeman.org/projects/foreman/wiki/Dynamic_disk_partitioning

>
> Does this disklayout variable replace or augment the actual provisioning
> commands that layout partitions?
>
> And is that block of code actually required to provision at all and what
> does it do? I've commented it out in test and the server still seem to get
> their partitions setup properly.

Hope the above helps

··· On Friday 04 of March 2016 14:44:32 Nathan Peters wrote:


Marek

1 Like