Raising an error within a template

Hi,

I've just started using Foreman 1.8 and I'm really impressed. It's come a
long way since I last used it.

I need the ability to raise an error from within a template/partition table.
The idea behind this is to enforce a particular partitioning scheme against
certain fqdns that match a regex.

For example, in the particular partition table, I want to say:

If fqdn doesn't match /regex/ then raise an error to the web ui. This is
to prevent people in the org from provisioning boxes with a
wrongly-formatted fqdn.

Does anyone know if this is possible?

Thanks

J

You could try:

raise "not supported" unless @host.name =~ /regex/

It ought to show up in the build review step if users went through it,
but otherwise probably wouldn't fire until the host tried to request its
template.

··· On 28/07/15 09:33, jamese wrote: > Hi, > > I've just started using Foreman 1.8 and I'm really impressed. It's come > a long way since I last used it. > > I need the ability to raise an error from within a template/partition table. > The idea behind this is to enforce a particular partitioning scheme > against certain fqdns that match a regex. > > For example, in the particular partition table, I want to say: > > If fqdn doesn't match /regex/ then raise an error to the web ui. This > is to prevent people in the org from provisioning boxes with a > wrongly-formatted fqdn. > > Does anyone know if this is possible?


Dominic Cleal
Red Hat Engineering