How to make host parameters mandatory

I have a couple of parameters that are added from a puppet class. I need to
make these mandatory so a host can't be saved without filling them in.
I've tried editing the parameters via the smart class parameter tab,
setting the Optional Input validator to be required and the validator type
to regex and the validator rule to ".\S.". But if I don't fill in a
default value I'm unable to save these settings.
If I fill in the default value here then the parameter is always set for
the host to the default value.

Any ideas on how I can create a mandatory host parameter (either with or
without puppet classes).

I would really like to be able to do this from Foreman as well. What I've
been reduced to is setting the default value to CHANGEME, and failing in
the puppet class if that parameter is required, but is set to CHANGEME.
This doesn't stop the host from being created, but it does fail the puppet
run.

Also note that you can use something like <%= @host.facts_hash['ipaddress']
%> within the parameter default value (or a range of other settings which
Foreman knows about)

ยทยทยท On Wednesday, March 25, 2015 at 4:52:56 PM UTC-7, Francois Herbert wrote: > > I have a couple of parameters that are added from a puppet class. I need > to make these mandatory so a host can't be saved without filling them in. > I've tried editing the parameters via the smart class parameter tab, > setting the Optional Input validator to be required and the validator type > to regex and the validator rule to ".*\S.*". But if I don't fill in a > default value I'm unable to save these settings. > If I fill in the default value here then the parameter is always set for > the host to the default value. > > Any ideas on how I can create a mandatory host parameter (either with or > without puppet classes). > >