What's the correct way to deploy files

Hi there,

I'm very new to Foreman and puppet to. I'm able to deploy some
configuration files with a simple puppet setup like this

file { "/my/super/config/file":
source => "puppet://my/super/config/file-template",
recurse => true,
owner => "my-owner",
group => "my-group",
mode => "600",
require => User["required-user"],
}

But I'm unable to figure out how to do something simple as that with forman
on top of puppet. Do I have to write a puppet class for such things?

Markus

> Hi there,
>
> I'm very new to Foreman and puppet to. I'm able to deploy some
> configuration files with a simple puppet setup like this
>
> file { "/my/super/config/file":
> source => "puppet://my/super/config/file-template",
> recurse => true,
> owner => "my-owner",
> group => "my-group",
> mode => "600",
> require => User["required-user"],
> }
>
>
> But I'm unable to figure out how to do something simple as that with forman
> on top of puppet. Do I have to write a puppet class for such things?

Yes, Foreman provides what's called an External Node Classifier to
Puppet, which doesn't define inidividual resources like files, but
entire classes.

https://docs.puppetlabs.com/guides/external_nodes.html#considerations-and-differences-from-node-definitions

··· On Thu, Dec 04, 2014 at 09:41:56AM -0800, hirnschmalz wrote:

Markus


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Stephen Benjamin


Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham,
Michael O’Neill, Charles Peters

Hi Stephen,

thank you for your answer.
Maybe you can give me another hint.

If I use a module like https://forge.puppetlabs.com/dominickaiser/filepush
how can I push multiple files. At the moment I'm only able to push one
single file via the class.

Markus

··· Am Donnerstag, 4. Dezember 2014 22:42:36 UTC+1 schrieb Stephen Benjamin: > > > Yes, Foreman provides what's called an External Node Classifier to > Puppet, which doesn't define inidividual resources like files, but > entire classes. > > > https://docs.puppetlabs.com/guides/external_nodes.html#considerations-and-differences-from-node-definitions > > > > > > > Markus > > > > -- > > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to foreman-user...@googlegroups.com . > > To post to this group, send email to forema...@googlegroups.com > . > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > > > -- > Stephen Benjamin > > ______________________________________________________ > Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn > Handelsregister: Amtsgericht München, HRB 153243 > Geschäftsführer: Charles Cachera, Michael Cunningham, > Michael O'Neill, Charles Peters > > >

> Hi Stephen,
>
> thank you for your answer.
> Maybe you can give me another hint.
>
> If I use a module like https://forge.puppetlabs.com/dominickaiser/filepush
> how can I push multiple files. At the moment I'm only able to push one
> single file via the class.
>

That class only supports one file, I'm not sure what use it really is.

I wouldn't manage things like that through the ENC. I would create
something like my own "defaults" class that configures motd, some
default packages I like to have installed, etc in one place and add that
to my foreman hosts, not use Foreman to manage individual resources.

··· On Fri, Dec 05, 2014 at 03:35:44AM -0800, hirnschmalz wrote:

Markus

Am Donnerstag, 4. Dezember 2014 22:42:36 UTC+1 schrieb Stephen Benjamin:

Yes, Foreman provides what’s called an External Node Classifier to
Puppet, which doesn’t define inidividual resources like files, but
entire classes.

https://docs.puppetlabs.com/guides/external_nodes.html#considerations-and-differences-from-node-definitions

Markus


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com <javascript:>.
To post to this group, send email to forema...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Stephen Benjamin


Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham,
Michael O’Neill, Charles Peters


Stephen Benjamin


Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham,
Michael O’Neill, Charles Peters

Hello … again :slight_smile:

thanks for your input.

For now I've configured host groups like

Webserver
Webserver/nginx
Webserver/apache

So if I understand you correctly you would create classes for those host
groups

fx a webserver class wich installs all my packages needed by nginx and
apache like imagemagick, php-apcu etc. And than you would create two more
classes which will install the webservice specific packages (nginx, apache
modules etc) and basic configuration files?

How would you handle the configuration of the single vhosts on the server?
Also single classes for every webhost?

Markus

··· Am Freitag, 5. Dezember 2014 12:44:26 UTC+1 schrieb Stephen Benjamin: > > > That class only supports one file, I'm not sure what use it really is. > > I wouldn't manage things like that through the ENC. I would create > something like my own "defaults" class that configures motd, some > default packages I like to have installed, etc in one place and add that > to my foreman hosts, not use Foreman to manage individual resources. > > > -- > Stephen Benjamin > > ______________________________________________________ > Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn > Handelsregister: Amtsgericht München, HRB 153243 > Geschäftsführer: Charles Cachera, Michael Cunningham, > Michael O'Neill, Charles Peters > > >

> Hello … again :slight_smile:
>
> thanks for your input.
>
> For now I've configured host groups like
>
> Webserver
> Webserver/nginx
> Webserver/apache
>
> So if I understand you correctly you would create classes for those host
> groups
>
> fx a webserver class wich installs all my packages needed by nginx and
> apache like imagemagick, php-apcu etc. And than you would create two more
> classes which will install the webservice specific packages (nginx, apache
> modules etc) and basic configuration files?
>
> How would you handle the configuration of the single vhosts on the server?
> Also single classes for every webhost?

Hi,

It's really up to you how to organize things. Some people do things
a bit dynamically where you can use Foreman parameters +
create_resources in puppet to configure multiple vhosts. Others prefer
to keep it all in Puppet, or bypass Foreman entirely and use Heira.

You can use things like existing classes from forge.puppetlabs.com or
write your own.

There's really a lot of possibilities :slight_smile:

··· On Fri, Dec 05, 2014 at 04:23:28AM -0800, hirnschmalz wrote:

Markus

Am Freitag, 5. Dezember 2014 12:44:26 UTC+1 schrieb Stephen Benjamin:

That class only supports one file, I’m not sure what use it really is.

I wouldn’t manage things like that through the ENC. I would create
something like my own “defaults” class that configures motd, some
default packages I like to have installed, etc in one place and add that
to my foreman hosts, not use Foreman to manage individual resources.


Stephen Benjamin


Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham,
Michael O’Neill, Charles Peters


Stephen Benjamin


Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham,
Michael O’Neill, Charles Peters