Puppet module for managing configuration of Katello/Foreman (not installation)

Hi,

I have a problem with my current Foreman/Katello setup. I would like to
keep my configuration for the more "slowly changing"* config of
Katello/Foreman in puppet (or any similar tool). But I haven't found any
readymade puppet module for it.

One example is defining GPG-keys, and a Products in Katello, example:

katello::gpg_key{'RPM-GPG-KEY-CentOS-7':
ensure=>present,
source=>'puppet:///…',
}

katello::product{'Puppet':
ensure=present,
label=>'puppetlabs-product',
repositories=>['…'],
}

Is there such a puppet module? It seams simple enough to build one around
the hammer-cli. It seams strange that it haven't already been done or maybe
I'm just haven't fount it?

*) Config like, Organizations, Locations, Products, Repos, GPG-keys,
activation-keys, Lifecycle envs… etc

Regards
Rickard von Essen

+1

I was planning to do something like this but haven't had the time yet.

After setting up a complete environment I want to export it and import
the config on a fresh install with all the "Organizations, Locations,
Products, Repos, GPG-keys, activation-keys, Lifecycle envs… etc".
Sometimes a database import doesn't cut it and I have been reinstalling
my environment a lot so it's a lot of work getting everything setup again.

Maybe we can collaborate?

Kind regards,

Jorick

··· On 02/22/2015 09:53 PM, Rickard von Essen wrote: > Hi, > > I have a problem with my current Foreman/Katello setup. I would like > to keep my configuration for the more "slowly changing"* config of > Katello/Foreman in puppet (or any similar tool). But I haven't found > any readymade puppet module for it. > > One example is defining GPG-keys, and a Products in Katello, example: > > > > katello::gpg_key{'RPM-GPG-KEY-CentOS-7': > ensure=>present, > source=>'puppet:///...', > } > > katello::product{'Puppet': > ensure=present, > label=>'puppetlabs-product', > repositories=>['...'], > } > > > > Is there such a puppet module? It seams simple enough to build one > around the hammer-cli. It seams strange that it haven't already been > done or maybe I'm just haven't fount it? > > *) Config like, Organizations, Locations, Products, Repos, GPG-keys, > activation-keys, Lifecycle envs.. etc > > Regards > Rickard von Essen > -- > 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.

Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts


Tel: 053 20 30 270 	info@netbulae.eu 	Staalsteden 4-3A 	KvK 08198180
Fax: 053 20 30 271 	www.netbulae.eu 	7547 TA Enschede 	BTW NL821234584B01

And while we're at it, maybe we can hook it up to git.

It would be easier to manage things like provisioning templates and GPG
keys from a repository.

Keeping up with merging customized provioning templates with updated
community templates is a hassle currently.

Regards,

Jorick

··· On 02/24/2015 03:47 PM, Jorick Astrego wrote: > +1 > > I was planning to do something like this but haven't had the time yet. > > After setting up a complete environment I want to export it and import > the config on a fresh install with all the "Organizations, Locations, > Products, Repos, GPG-keys, activation-keys, Lifecycle envs.. etc". > Sometimes a database import doesn't cut it and I have been > reinstalling my environment a lot so it's a lot of work getting > everything setup again. > > Maybe we can collaborate? > > Kind regards, > > Jorick > > On 02/22/2015 09:53 PM, Rickard von Essen wrote: >> Hi, >> >> I have a problem with my current Foreman/Katello setup. I would like >> to keep my configuration for the more "slowly changing"* config of >> Katello/Foreman in puppet (or any similar tool). But I haven't found >> any readymade puppet module for it. >> >> One example is defining GPG-keys, and a Products in Katello, example: >> >> > >> katello::gpg_key{'RPM-GPG-KEY-CentOS-7': >> ensure=>present, >> source=>'puppet:///...', >> } >> >> katello::product{'Puppet': >> ensure=present, >> label=>'puppetlabs-product', >> repositories=>['...'], >> } >> > >> >> Is there such a puppet module? It seams simple enough to build one >> around the hammer-cli. It seams strange that it haven't already been >> done or maybe I'm just haven't fount it? >> >> *) Config like, Organizations, Locations, Products, Repos, GPG-keys, >> activation-keys, Lifecycle envs.. etc >> >> Regards >> Rickard von Essen >> -- >> 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. > > > > > Met vriendelijke groet, With kind regards, > > Jorick Astrego* > > Netbulae Virtualization Experts * > ------------------------------------------------------------------------ > Tel: 053 20 30 270 info@netbulae.eu Staalsteden 4-3A KvK 08198180 > Fax: 053 20 30 271 www.netbulae.eu 7547 TA Enschede BTW NL821234584B01 > > > ------------------------------------------------------------------------ > > -- > 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.

Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts


Tel: 053 20 30 270 	info@netbulae.eu 	Staalsteden 4-3A 	KvK 08198180
Fax: 053 20 30 271 	www.netbulae.eu 	7547 TA Enschede 	BTW NL821234584B01

THis would be pretty interesting I think. There's a couple of approaches
that you could use to do it.

FIrstly, if you only want to set things up at install-time (i.e after a db
wipe) then there's the seed files. You can create a file like [1] at
db/seeds.d/99-local.rb and then the "foreman-rake db:seed" task will
include it. I use something like this to regularly wipe my dev db and
repopulate it with my subnets, CRs, templates, OSs, etc.

Alternatively, if you looks here[2,3] you'll see we already have a puppet
type/provider for creating/updating smart proxies via the Foreman API. It
would be lovely to have more of these for other API interactions, and could
prove a useful starting point for your own puppet types.

Looking forward to seeing where you get to :slight_smile:

Greg

[1] https://gist.github.com/GregSutcliffe/0795e29d1d2d8a8592a8
[2]
https://github.com/theforeman/puppet-foreman/blob/master/lib/puppet/type/foreman_smartproxy.rb
[3]
https://github.com/theforeman/puppet-foreman/blob/master/lib/puppet/provider/foreman_smartproxy/rest_v2.rb

I haven't gotten much community traction on this, but I have a hammer extension that may be of interest: hammer-cli-csv[1]. It can either export data from a running server to CSV, or import CSV into a running server. I wrote it with the intent of being able to do this:

% hammer --server myserver csv organizations --csv-export | hammer --server mybackup csv organizations

Since to date it has been largely a development tool, albeit one I use several times a day, it is not highly polished. Also, since my job is to work on katello/Satellite-6, the foreman resources don't get a lot of attention. I would very much welcome contributions.

[1] https://github.com/Katello/hammer-cli-csv

··· ----- Original Message ----- > And while we're at it, maybe we can hook it up to git. > > It would be easier to manage things like provisioning templates and GPG > keys from a repository. > > Keeping up with merging customized provioning templates with updated > community templates is a hassle currently. > > Regards, > > Jorick > > On 02/24/2015 03:47 PM, Jorick Astrego wrote: > > +1 > > > > I was planning to do something like this but haven't had the time yet. > > > > After setting up a complete environment I want to export it and import > > the config on a fresh install with all the "Organizations, Locations, > > Products, Repos, GPG-keys, activation-keys, Lifecycle envs.. etc". > > Sometimes a database import doesn't cut it and I have been > > reinstalling my environment a lot so it's a lot of work getting > > everything setup again. > > > > Maybe we can collaborate? > > > > Kind regards, > > > > Jorick > > > > On 02/22/2015 09:53 PM, Rickard von Essen wrote: > >> Hi, > >> > >> I have a problem with my current Foreman/Katello setup. I would like > >> to keep my configuration for the more "slowly changing"* config of > >> Katello/Foreman in puppet (or any similar tool). But I haven't found > >> any readymade puppet module for it. > >> > >> One example is defining GPG-keys, and a Products in Katello, example: > >> > >> > > >> katello::gpg_key{'RPM-GPG-KEY-CentOS-7': > >> ensure=>present, > >> source=>'puppet:///...', > >> } > >> > >> katello::product{'Puppet': > >> ensure=present, > >> label=>'puppetlabs-product', > >> repositories=>['...'], > >> } > >> > > >> > >> Is there such a puppet module? It seams simple enough to build one > >> around the hammer-cli. It seams strange that it haven't already been > >> done or maybe I'm just haven't fount it? > >> > >> *) Config like, Organizations, Locations, Products, Repos, GPG-keys, > >> activation-keys, Lifecycle envs.. etc > >> > >> Regards > >> Rickard von Essen > >> -- > >> 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. > > > > > > > > > > Met vriendelijke groet, With kind regards, > > > > Jorick Astrego* > > > > Netbulae Virtualization Experts * > > ------------------------------------------------------------------------ > > Tel: 053 20 30 270 info@netbulae.eu Staalsteden 4-3A KvK 08198180 > > Fax: 053 20 30 271 www.netbulae.eu 7547 TA Enschede BTW NL821234584B01 > > > > > > ------------------------------------------------------------------------ > > > > -- > > 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. > > > > > Met vriendelijke groet, With kind regards, > > Jorick Astrego > > Netbulae Virtualization Experts > > ---------------- > > Tel: 053 20 30 270 info@netbulae.eu Staalsteden 4-3A KvK 08198180 > Fax: 053 20 30 271 www.netbulae.eu 7547 TA Enschede BTW NL821234584B01 > > ---------------- > > -- > 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. >