PE 3.1: mco find -C Result is Not Consistent With PE Console

asked 2014-06-10 16:05:44 -0500

Jeff Johnson gravatar image

updated 2014-06-10 16:15:21 -0500

I'm trying to use mcollective to get a list of nodes that have a certain Puppet class assigned to them. According to the Puppet Enterprise Orchestration docs, the -C flag for the mco command should work (emphasis is mine):

Classes are the Puppet classes that are assigned to a node. This includes classes assigned in the console, assigned via Hiera, declared in site.pp, or declared indirectly by another class. Use the -C or --with-class option with a class name to filter on classes.

What I'm finding is that when I use mcollective to query nodes with the -C, the results do not always match what is specified in the Puppet Enterprise Console.

Question: How/When does mcollective "know" when the classes assigned to a node via the Puppet Enterprise Console?

Steps to Reproduce Using the Puppet Enterprise Console

  1. I assign a Puppet class called apcs to a node called servicing.
  2. I assign a puppet class called akamai to a node called logscraper.

At some point (unfortunately I'm not really sure what the trigger is; hence this question), mcollective "knows" that apcs is assigned to the servicing node and akamai is assigned to the logscraper node.

  1. I assign the apcs class to the node called logscraper.

At this point, I have the following (shown in the Puppet Enterprise Console):

  • the servicing node has the apcs class assigned to it.
  • the logscraper node has the apcs AND akamai class assigned to it.

Expected Behavior

mco ping -C akamai should return logscraper.

mco ping -C apcs should return servicing and logscraper.

Actual Behavior

mco ping -C akamai returns logscraper.

mco ping -C apcs returns servicing.

I tried running the /opt/puppet/sbin/refresh-mcollective-metadata cron job, but that didn't help.

edit retag flag offensive close merge delete