Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
luminalflux
May 27, 2005



So where should I be looking instead?

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

luminalflux posted:

What's a good resource to learn modern puppet if I've spent the last 3 years in chef-land?

Just out of curiosity, how come you want to move to puppet if you've been using chef?

evol262
Nov 30, 2010
#!/usr/bin/perl

swampcow posted:

The link you provided is the old way of writing modules. The params section is obsoleted by hiera and automatic parameter lookups, for instance. Also, puppetlabs is now teaching that you shouldn't use inheritance.

Admittedly, I just pulled the first bit on modules Google picked up on Puppetlabs' website, but...

I haven't seen anything indicating that inheritance is out, except for not inheriting across modules, which is basic OO stuff that shouldn't even bear mentioning.

I'm also curious if you have a link for params being obsoleted. I mentioned hiera because autoparams through hiera is best practice, but I haven't seen anything about params being obsoleted, especially since they're required for autoparams to work anyway. You still need them in your modules. If this is changing, I'd like to know.

swampcow
Jul 4, 2011

evol262 posted:

Admittedly, I just pulled the first bit on modules Google picked up on Puppetlabs' website, but...

I haven't seen anything indicating that inheritance is out, except for not inheriting across modules, which is basic OO stuff that shouldn't even bear mentioning.

I'm also curious if you have a link for params being obsoleted. I mentioned hiera because autoparams through hiera is best practice, but I haven't seen anything about params being obsoleted, especially since they're required for autoparams to work anyway. You still need them in your modules. If this is changing, I'd like to know.

When I said params were being obsoleted, I meant the params subclass that seems to be used everywhere. Sorry about the ambiguity.

As for class inheritance, when I took the puppetlabs class a few months ago, the instructor recommended against using them. I'm inclined to agree, since it's been easier in my experience to have a few well placed parameters, rather than several inherited classes while still having the need to specify parameters. Though I would be open to hear of a non-trivial example where inheritance is most appropriate.

Senso
Nov 4, 2005

Always working
Yeah, params are still used, so...?

code:
class derp (
    param1 = 'default',
    etc.
) {
}
Then you instantiate with

code:
class { 'derp':
    param1 => 'override'
}
OR just

code:
class { 'derp': }
If all your params are in Hiera.

Anyway, standard module structure.

Also I suggest this doc on the Role/Profile/Module method.

Senso fucked around with this message at 22:58 on Nov 11, 2014

swampcow
Jul 4, 2011

Senso posted:

Yeah, params are still used, so...?

code:
class derp (
    param1 = 'default',
    etc.
) {
}
Then you instantiate with

code:
class { 'derp':
    param1 => 'override'
}
OR just

code:
class { 'derp': }
If all your params are in Hiera.

Anyway, standard module structure[/ur].

Also I suggest this doc on the [url=http://www.craigdunn.org/2012/05/239/]Role/Profile/Module
method.

If you're using hiera to fetch parameter values, you don't want to use this method of declaring classes. Because with the above method, you can only declare the class in one place.

However, if you do 'include myclass', it can be declared in multiple places without ill effect while still getting the parameter values from hiera.

evol262
Nov 30, 2010
#!/usr/bin/perl

swampcow posted:

When I said params were being obsoleted, I meant the params subclass that seems to be used everywhere. Sorry about the ambiguity.

As for class inheritance, when I took the puppetlabs class a few months ago, the instructor recommended against using them. I'm inclined to agree, since it's been easier in my experience to have a few well placed parameters, rather than several inherited classes while still having the need to specify parameters. Though I would be open to hear of a non-trivial example where inheritance is most appropriate.

You really don't have to look any farther than apache to see where inheritance can be useful. Obviously it's not appropriate everywhere, but I don't think I'd recommend against using it entirely, since there are some patterns that it's just indispensable for. Especially if you're keeping hierarchical data for autoparams in JSON or etcd or somewhere else where it makes sense to have all the apache poo poo under the same tree instead of multiple base classes that all do apache stuff.

Senso posted:

Yeah, params are still used, so...?

code:
class derp (
    param1 = 'default',
    etc.
) {
}
Then you instantiate with

code:
class { 'derp':
    param1 => 'override'
}
OR just

code:
class { 'derp': }
If all your params are in Hiera.

Anyway, standard module structure[/ur].

Also I suggest this doc on the [url=http://www.craigdunn.org/2012/05/239/]Role/Profile/Module
method.

I suspect this is what he meant. This isn't good practice. You should just instantiate by importing and let hiera handle populating all the parameters. You still need them in your module so autoparams works, but don't do ^

Senso
Nov 4, 2005

Always working
Fair enough, it's true that "include module" allows using it more than once. I've never had to declare a module more than once anyway, because everything is in its own profile. The profiles I include them because they are re-used on different nodes.

luminalflux
May 27, 2005



fletcher posted:

Just out of curiosity, how come you want to move to puppet if you've been using chef?

I don't want to per se, but newjob uses puppet and I have 3 months until I start so might as well get proficient.

adorai
Nov 2, 2002

10/27/04 Never forget
Grimey Drawer
if I am starting from scratch, should I just say gently caress puppet and use something else? What is the something else? Chef?

evol262
Nov 30, 2010
#!/usr/bin/perl

adorai posted:

if I am starting from scratch, should I just say gently caress puppet and use something else? What is the something else? Chef?

Starting from scratch in 2014, use salt or ansible. Use puppet or chef if you're really into ruby (chef) or want to integrate with vendor kit (either).

You can find out how to do almost anything with puppet or chef, though it may take a little while to figure out how to get some cookbook from 2011 to work.

Ansible and salt rarely need you to go on the internet because they're somewhat saner, but aren't established enough for F5 and Netapp to officially support them yet (they may now, but those are just two companies I picked out of a hat).

Powershell DCM also looks interesting.

All config management systems have pros and cons, and places where they're weak or strong (tooling around them, windows support, scaling, community, ease of use, ease of extensibility), and it's really hard to just recommend one without knowing more about your use case

SSH IT ZOMBIE
Apr 19, 2003
No more blinkies! Yay!
College Slice
Ah, huh. Interesting. We were thinking about setting up puppet, just because we heard of it and we're starting to deploy more linux servers. Never heard of salt. So I guess we should be looking at that, instead?

evol262
Nov 30, 2010
#!/usr/bin/perl

SSH IT ZOMBIE posted:

Ah, huh. Interesting. We were thinking about setting up puppet, just because we heard of it and we're starting to deploy more linux servers. Never heard of salt. So I guess we should be looking at that, instead?

If you currently have config management, use whatever that is.

If you don't currently have config management, have in-house python expertise (or can live with community stuff), and never want to use foreman or tie other infra into your config management system (or can wait until your vendor supports it), use salt.

If you don't currently have cm and have in-house expertise in Ruby or want to reuse cookbooks written by vendors (rackspace and others), use chef.

If you don't currently have cm and have engineers who can write addons in some language, use ansible.

If you use Windows, look at powershell DCM.

If it's cfengine, replace it with something else.

If you don't currently have cm and want to tie in other infra or vendor tools (foreman, katello, whatever), or have an enormous base of community stuff in a DSL, use puppet.

Puppet and chef (puppet a little more so) are most likely to let you add support for your appliances and other equipment without ever touching a language. Chef's basically pure ruby, which has its appeal, but chef and puppet are more similar than different. They're the established "enterprise" tools.

Salt and ansible are newcomers. Ansible's schtick is flexibility. Any language you want, all you need is ssh. Salt is a little more "puppet in Python", but it's a few years newer, and doesn't have as much cruft yet. Nobody's going to debate what is isn't deprecated. Because it isn't new enough to have anything deprecated.

They're all good choices. But you need to pick which one is right for you.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.
The only way to win the configuration management game is not to play. (They're great if you have to support piles of random apps, but if you're mostly supporting your own app's infrastructure, there's better ways to do almost all of it. Aim for immutable infrastructure everywhere you can.)

Salt and Ansible lack many higher-level abstractions, so they're a good match if you tend to write one-off scripts for everything you run anyway. I've found them to be unmanageable when you start trying to wrangle heterogeneous infrastructures with lots of different apps and non-identical configurations. Your mileage may vary.

swampcow
Jul 4, 2011

To add another dimension to the discussion, what cm comes with good orchestration? Puppet has MCollective, but it's not something you can just drop in. A puppetlabs employee said that it's not quite up to snuff yet.

If I switched to another cm, I'd want orchestration plus all the advantages of hiera.

stubblyhead
Sep 13, 2007

That is treason, Johnny!

Fun Shoe

swampcow posted:

To add another dimension to the discussion, what cm comes with good orchestration? Puppet has MCollective, but it's not something you can just drop in. A puppetlabs employee said that it's not quite up to snuff yet.

If I switched to another cm, I'd want orchestration plus all the advantages of hiera.

If you have more money than sense you could use HP Server Automation and Operations Orchestration. They're separate products but they play reasonably nice with each other.

Docjowles
Apr 9, 2009

Salt actually started out as a tool for remote execution and orchestration and eventually grew to include Puppet-style config management. So it's a great option in that respect.

Salt's version of hiera is called "Pillar" and works similarly.

swampcow
Jul 4, 2011

Docjowles posted:

Salt actually started out as a tool for remote execution and orchestration and eventually grew to include Puppet-style config management. So it's a great option in that respect.

Salt's version of hiera is called "Pillar" and works similarly.

This is very good to know, thanks.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

swampcow posted:

To add another dimension to the discussion, what cm comes with good orchestration? Puppet has MCollective, but it's not something you can just drop in. A puppetlabs employee said that it's not quite up to snuff yet.

If I switched to another cm, I'd want orchestration plus all the advantages of hiera.
MCollective is up to snuff, but you have to understand its limitations when writing plugins. It's not designed for long-running jobs. If you need long-running jobs, it does best when you integrate it with a local task queue like Resque and just let it return immediately after job submission.

pram
Jun 10, 2001
Since we're on the subject of mcollective: does anyone use/know of a client/agent that takes a script as input and executes it on the nodes?

I see implemented_by in the docs but I don't think it's intended to be used that way.

https://docs.puppetlabs.com/mcollective/simplerpc/agents.html#actions-in-external-scripts

Or maybe I shouldn't bother with simplerpc.

Adbot
ADBOT LOVES YOU

adorai
Nov 2, 2002

10/27/04 Never forget
Grimey Drawer
Thanks to this thread, I started experimenting with ansible. Right now in my learning phase I am trying to lab up the automatic configuration of an HA wordpress blog, including 2x load balancers, 3x web servers, and 3x db servers. Anyone have any other suggestions for a neat lab to work on that will actually teach me something here?

  • Locked thread