Pages

Friday, January 30, 2015

Red Hat Satellite 6.0 - Error 400 on Server

I believe that I have ran into a bug in Red Hat Satellite 6 and puppet.  None of my puppet agents are able to retrieve the catalog from the puppet master anymore.

[root@server ~]# puppet agent -tv
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: wrong number of arguments (2 for 1)
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

After much digging around, I noticed that puppet on my satellite server was at a much newer version (3.7.x) than my client (3.6.x). I think what happened is that when I was messing around with building puppet modules, a tutorial had me create a .gemfile which installed the latest puppet through the gem command.

To resolve the issue, I did:

  • gem uninstall puppet
  • yum reinstall puppet
  • log out and back in
Now if I run "puppet help" it says that it is 3.6.2. I am also able to run puppet agent -tv without error on a client server as well.

Monday, January 26, 2015

Red Hat Satellite 6 - Puppet, What the Hell do I do Now?

One of my major issues with Satellite 6 has been centralized configuration management.  In fact, not having configuration management working correctly is the major reason why my production systems are still using 5.7.

All the documentation I have found talks about what puppet is, where to get modules and how to get the modules into a content view. That's great.  After I get a module added to a content view, what then?  How do I actually make it do something?

After much Internet research, I have finally made the ntp puppet module actually configure something on a remote server through Satellite 6.  Here is what I did:

This document assumes you have already downloaded the ntp puppet module from the puppet forge (https://forge.puppetlabs.com/puppetlabs/ntp), uploaded it to a custom repository and published to a content view the server is subscribed to. Pretty much everything the official documentation has you do, besides actually doing something with it.

Configuring the ntpd pool server using the puppet module in Satellite 6.

  1. Sign into Satellite
  2. Click on Configure > Puppet classes
  3. Click on the ntp class name. (If there is nothing on this screen, you didn't do something correctly)
  4. Click on the Smart Class Parameter tab
  5. This screen shows all the available classes which can be set for this puppet module. 
  6. I want to make sure ntp is installed, is running and has my pool servers.
  7. Scroll down to "package ensure" and click on it.
  8. Check the box next to "Override." Set "Parameter type" to string. In "Default Value", type latest
  9. Scroll down to "servers" and click on it.
  10. Click the "Override" check box
  11. Set "Paramater type" to "array"
  12. In "Default value" type in a comma separated list of your ntp pool servers as follows:
    1. ["ntp1.example.com","ntp2.example.com"]
  13. Scroll to "service enable" and click on it
  14. Check the "Override" box
  15. Change "Parameter type" to "boolean"
  16. Type "true" into default value
  17. Scroll all the way down to the bottom of the page and press submit.
  18. Browse to Hosts > All Hosts
  19. Click on the server
  20. Click on Edit
  21. Click on Puppet Classes
  22. Expand the ntp class, click on ntp. ntp should show up under the "Included classes" area. Do not select any of the other things. I'm still looking into what those do.
  23. Click submit
  24. Click on the YAML button, this will show you exactly what is being passed to the puppet agent. You should see your additional configuration settings listed
  25. Click back
  26. Go onto the console of the server and run "puppet agent -tv" as root.  If everything is correct, your /etc/ntp.conf file should now have your servers in there. 
  27. I uninstalled the ntpd package and ran puppet, it installed the service, started it and setup my configuration file.
  28. Success!