Ask Your Question
0

Puppet with Satellite 6. Customize puppet modules

asked 2015-01-21 11:27:11 -0600

Biju Joseph gravatar image

Puppet with Satellite 6. How to configure puppet modules for different hosts group. For example with I want to manage resolv.conf and ntp.conf with puppet, but wanted to give different values based on server group. For example I have a server group for Dallas servers in which I have a specific set of DNS and NTP servers. For another server group for Austin servers I have different set of DNS and NTP. How I can accomplish this with puppet modules.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2015-02-12 13:23:55 -0600

tsheriffk gravatar image

If you are using Satellite 6 (or Foreman), what we have found that is easiest is the following:

  1. From Satellite 6, click on Configure > Puppet classes
  2. Locate the module, NTP in your example and click on it
  3. Click on the smart class parameter tab
  4. Locate the item you wish to overrride. For the NTP module I use, this would be the "servers" parameter. Click on the parameter to make it the active focus.
  5. Check the "override" box to allow Satellite to override the value
  6. Provide a sane default value to use when nothing matches
  7. In the "Order" box under the "Override Value For Specific Hosts" section, add "location" as a valid matcher
  8. Add the "Match" and "Value" sections for your environment.
    For example, Match : Location = chicago Value : ["10.44.34.10","10.44.88.1","10.44.88.2"]

Any host that you add that has location set to chicago, will automatically substitute your default values, with the values that you defined in the override.

Note: if you want to override on a host by host basis, any parameter that you had selected "override" as shown in step 4, will be available under the hosts smart class parameter tab as well.

Hope that makes sense.. this is exactly how we are doing it with Foreman/Sat 6, which it sometimes a little different to the standard puppet way of doing things.

edit flag offensive delete link more

Comments

the way i do it, is define a fact associated with the servergroups, so that fact would return in that case Dallas, or other locations supported. and in hiera i will capture the different data related to each site, and the ntp profile module gets its data from hiera.

Walid Shaari gravatar imageWalid Shaari ( 2015-02-14 04:20:05 -0600 )edit

I am interested if some one is using PE with foreman, especially in large scale and geo locations.

Walid Shaari gravatar imageWalid Shaari ( 2015-02-14 04:21:00 -0600 )edit
0

answered 2015-01-21 15:56:15 -0600

Biju Joseph gravatar image

Thanks Greg. I am very new to Puppet. If possible, can you give an example of how to use hiera with puppet ntp module. I will definitely go thru the links to get a better understanding.

edit flag offensive delete link more
0

answered 2015-01-21 14:49:12 -0600

GregLarkin gravatar image

updated 2015-01-21 21:48:10 -0600

Hiera is your friend! There are loads of writeups about how to use it to separate your data from your Puppet code, so I'll list some of them here for your review:

Hope it helps!

UPDATE: The puppetlabs/ntp module exposes a number of parameters that you can set explicitly in code when declaring the class like so:

class { '::ntp':
  servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
}

You can also place keys and values in your Hiera data files to automatically set those parameters via Hiera's automatic data binding feature. If you want to automatically set the ntp::service_enable, ntp::service_ensure and ntp::service_manage parameters, you would place the following in a data file in your Hiera hierarchy:

---
ntp::service_enable: true
ntp::service_ensure: true
ntp::service_manage: true

Now you can use include ntp in some other part of your Puppet code, and the 3 parameters above will be automatically set in the ntp class when it's compiled into the catalog.

edit flag offensive delete link more

Comments

If you found my answer helpful, please mark it correct at your convenience. Thank you!

GregLarkin gravatar imageGregLarkin ( 2015-01-23 16:36:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-01-21 11:27:11 -0600

Seen: 2,712 times

Last updated: Feb 12 '15