Finisher template question

Our Foreman instance is built with a finisher template which we use to
configure Chef client and carry out disk partitioning work.

The template works correctly. What I'd like to know is whether it's
possible to pass in values at build time. In our template we would like to
be able to configure how much unpartitioned disk is to be allocated as
swap. At the moment it is hardcoded as follows:

swapsize=2048

I have tried changing that to a ruby variable such as:

swapsize=<%= @swapsize %>

I have tried on the new host build assigning swapsize as a parameter but
haven't had any success, it doesn't appear to pass the value in at all.

Is this possible and how should I be able to do this?

Many thanks for your help.

You're almost correct :slight_smile:

Try <%= @host.params['swapsize'] %>

Hope that helps,
Greg

ยทยทยท On 20 February 2015 at 11:26, wrote: > Our Foreman instance is built with a finisher template which we use to > configure Chef client and carry out disk partitioning work. > > The template works correctly. What I'd like to know is whether it's > possible to pass in values at build time. In our template we would like to > be able to configure how much unpartitioned disk is to be allocated as swap. > At the moment it is hardcoded as follows: > > swapsize=2048 > > I have tried changing that to a ruby variable such as: > > swapsize=<%= @swapsize %> > > I have tried on the new host build assigning swapsize as a parameter but > haven't had any success, it doesn't appear to pass the value in at all. > > Is this possible and how should I be able to do this?