How to use Foreman to apply a defined resource several times on a host

I would like to apply the apache::vhost define several times using Foreman.

apache::vhost (ww1.example.net:){

}

apache::vhost (ww2.example.net:){

}

… etc …

is there anyway I can achieve this in foreman?.
While it is is pretty simple to do this using manifest files, but in
foreman I do not
see How to achieve this.

I have some parameterized classes that work fine in foreman but they can be
applied
only once to a puppet node.

Please Provide example.

thanks.

Perfect, I did it, but How can I set this YAML structure from the Foreman UI

data:
first:
b: "param 1b"
second:
b: "param 2b"

··· a: "param 1a" a: "param 2a"

I set the variable (host) from foreman the YAML gives me.

environment: development
classes:
apache::vhost:
host: ny-dev-1000

I ended up with: err: Could not retrieve catalog from remote server: Error
400 on SERVER: can’t convert nil into Hash at …

Thanks.

On Wednesday, July 3, 2013 3:00:06 PM UTC-4, svc.r...@gmail.com wrote:

I would like to apply the apache::vhost define several times using Foreman.

apache::vhost (ww1.example.net:){

}

apache::vhost (ww2.example.net:){

}

… etc …

is there anyway I can achieve this in foreman?.
While it is is pretty simple to do this using manifest files, but in
foreman I do not
see How to achieve this.

I have some parameterized classes that work fine in foreman but they can
be applied
only once to a puppet node.

Please Provide example.

thanks.

It works Like a charm !!!
Thanks.

··· On Wednesday, July 3, 2013 3:00:06 PM UTC-4, svc.r...@gmail.com wrote: > > I would like to apply the apache::vhost define several times using Foreman. > > apache::vhost (ww1.example.net:){ > > } > > apache::vhost (ww2.example.net:){ > > } > > ... etc ... > > is there anyway I can achieve this in foreman?. > While it is is pretty simple to do this using manifest files, but in > foreman I do not > see How to achieve this. > > I have some parameterized classes that work fine in foreman but they can > be applied > only once to a puppet node. > > Please Provide example. > > thanks. > >

There's an example of using create_resources with a YAML class parameter
in my reply to this thread:

There's also a plugin (which I've yet to try) that adds an API for
managing this data (no UI yet):
https://github.com/arnoudj/foreman_resources

Else I'd suggest creating role classes and then including those from
Foreman.

··· On 03/07/13 20:00, svc.rvbrand@gmail.com wrote: > I would like to apply the apache::vhost define several times using Foreman. > > apache::vhost (ww1.example.net:){ > > } > > apache::vhost (ww2.example.net:){ > > } > > ... etc ... > > is there anyway I can achieve this in foreman?. > While it is is pretty simple to do this using manifest files, but in > foreman I do not > see How to achieve this. > > I have some parameterized classes that work fine in foreman but they can > be applied > only once to a puppet node. > > Please Provide example.


Dominic Cleal
Red Hat Engineering