Docs: PE 2.0 » Puppet » Assigning a Class to a Node


PE 2.0 » Puppet » Assigning a Class to a Node


Puppet: Your First ModuleIndexPuppet: Next Steps


Puppet For New Users: Assigning a Class to a Node

In Puppet Enterprise, you assign classes to nodes using the console.

Adding a Class to the Console

The console doesn’t automatically load classes from the puppet master’s modules, so you must tell the console about a new class before you can use it. Use the “Add class” button in the console’s sidebar.

The “Add class” button:

The console's Add class button

Typing a class name:

The console's Add node class page

Done:

The list of classes with the new class highlighted

Assigning a Class to a Single Node

To assign the new class to one node at a time:

  • Go to that node’s page (by finding and clicking its name in one of the console’s lists of nodes)
  • Click “Edit”
  • Start typing the name of the class in its “Classes” field, then select the class you want from the auto-completion list
  • Save your changes

The edit button:

The edit button on a node's page

Typing a class name:

Typing a class name

A confirmed class name:

Selecting an auto-completed class name

Done:

The node's page, now with the new class assigned

Assigning a Class to a Group

Assigning a class to a group of nodes is nearly identical: go to that group’s page, and use the edit button and classes field as described above.

After adding a class to a group:

A group page with our class added

Making a Node Pull its Configuration

Nodes with your class will pull and apply their configurations within the next half hour. But if you want to make them run immediately, you can use the console’s live management page to control puppet agent.

  • Navigate to the live management page, then navigate to the “Control Puppet” section
  • In the sidebar, click “select none” and then re-select the handful of nodes that need to run
  • Click the “runonce” action, then confirm with the red “Run” button.

Preparing to trigger three runs:

Live management with three nodes selected and displaying the Control Puppet section

Confirming the runonce action:

The runonce action's "Run" confirmation button revealed

Viewing the Results of a Run

A few minutes after triggering a run, the selected nodes should be the most recent nodes appearing in the node list. In our case, we can see that this run made changes to one node, which has a blue checkmark by its name:

The list of nodes, with the three nodes we just ran at the top and a blue checkmark by one of them.

If we go to that node’s page, we can go to the most recent report and view what happened in the “log” tab:

The list of most recent reports for the changed node; the one at the top has a blue checkmark

The log tab for the most recent report. Puppet changed the mode of /etc/passwd were changed from 0666 to 0644.

For some reason, /etc/passwd had a permissions mode of 0666, which meant anyone could write to it! Puppet corrected that, and it now has the proper mode of 0644.


Puppet: Your First ModuleIndexPuppet: Next Steps


↑ Back to top