How are partition tables included in the build process?

How do partition tables get included in the kickstart process?

I see these lines in the default Katello kickstart file :

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

I understand from an earlier answer that the first part of that statement,
the @dynamic section is there to allow you to write your own partitioning
to /tmp/diskpart.cfg and then have it included.

What does the 2nd part of that statement do?

Is @host.disklayout a shortcut that includes the partition table defined
for that host when we created it, or is the partition table automatically
inserted by foreman/katello before / after the %pre section of the
kickstart file?

> How do partition tables get included in the kickstart process?
>
> I see these lines in the default Katello kickstart file :
>
> <% if @dynamic -%>
> %include /tmp/diskpart.cfg
> <% else -%>
> <%= @host.diskLayout %>
> <% end -%>
>
> I understand from an earlier answer that the first part of that
> statement, the @dynamic section is there to allow you to write your own
> partitioning to /tmp/diskpart.cfg and then have it included.
>
> What does the 2nd part of that statement do?
>
> Is @host.disklayout a shortcut that includes the partition table defined
> for that host when we created it

Yes, correct when it's not a "dynamic" partition table. It's simply
inserted at that point. If you preview the template you should see this.

> or is the partition table
> automatically inserted by foreman/katello before / after the %pre
> section of the kickstart file?

Only if using a dynamic partition table will something like this happen,
but it's again in the kickstart explicitly:

https://github.com/theforeman/community-templates/blob/develop/kickstart/provision.erb#L125-L129

In the regular non-dynamic case it's using the 2nd part of the
conditional you pointed to.

··· On 17/03/16 16:52, Nathan Peters wrote:


Dominic Cleal
dominic@cleal.org