{"id":15156619,"url":"https://github.com/puppetlabs/puppetlabs-node_manager","last_synced_at":"2025-12-11T21:47:38.823Z","repository":{"id":31315526,"uuid":"34877944","full_name":"puppetlabs/puppetlabs-node_manager","owner":"puppetlabs","description":"Create and manage PE node groups as resources.","archived":false,"fork":false,"pushed_at":"2025-02-04T02:20:17.000Z","size":247,"stargazers_count":10,"open_issues_count":11,"forks_count":23,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-11-07T16:43:48.865Z","etag":null,"topics":["classification","pe-console","puppet","puppet-enterprise"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puppetlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-30T21:34:07.000Z","updated_at":"2024-09-16T18:26:10.000Z","dependencies_parsed_at":"2024-05-02T12:08:27.209Z","dependency_job_id":"9e3fd931-b690-4975-be46-4c895d61c902","html_url":"https://github.com/puppetlabs/puppetlabs-node_manager","commit_stats":null,"previous_names":["puppetlabs/puppetlabs-node_manager","whatsaranjit/puppet-node_manager"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/puppetlabs/puppetlabs-node_manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppetlabs-node_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppetlabs-node_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppetlabs-node_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppetlabs-node_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puppetlabs","download_url":"https://codeload.github.com/puppetlabs/puppetlabs-node_manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppetlabs-node_manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27670680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","pe-console","puppet","puppet-enterprise"],"created_at":"2024-09-26T19:24:04.117Z","updated_at":"2025-12-11T21:47:38.767Z","avatar_url":"https://github.com/puppetlabs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node_manager\n\n[![Donated by Ranjit](https://img.shields.io/badge/donated%20by-@WhatsARanjit-fb7047.svg)](#transfer-notice)\n\nWe would like to inform you that during the release of version 1.0.0, the corresponding tag v1.0.0 was not created. After recognizing this, we created the tag, but it was created from the HEAD commit, so we deleted the newly created tag. To address this, we are publishing a new release, 1.0.1.\n\n#### Table of Contents\n\n1. [Overview](#overview)\n1. [Requirements](#requirements)\n1. [Authentication](#authentication)\n1. [Types](#types)\n    * [Node_group](#node_group)\n1. [Tasks](#tasks)\n    * [update_classes](#update_classes)\n1. [Functions](#functions)\n    * [node_groups()](#node_groups)\n    * [get_nodes()](#get_nodes)\n1. [Face](#face)\n1. [Things to do](#things-to-do)\n1. [Experimental](#experimental)\n\n## Overview\n\nCreate and manage PE node groups as resources.\n\n## Requirements\n\n* \\*nix operating system\n* Puppet \u003e= 3.7.1\n* New `https` provider which doesn't need `puppetclassify` gem\n\n## Authentication\n\n### PE Console server\n\nUsing the types and functions on the PE Console server will read the configuration at\n`/etc/puppetlabs/puppet/classifier.yaml` which contains the default server information\nand SSL certificate paths.  No extra configuration is necessary.\n\n### Remote client or custom information\n\nIn order to manage node groups from a remote client, you'll need to [whitelist a certificate](https://docs.puppet.com/pe/latest/nc_forming_requests.html#whitelisted-certificate)\nor [generate a token](https://docs.puppet.com/pe/latest/nc_forming_requests.html#authentication-token) with permissions to edit node groups.\nCreate a file at `/etc/puppetlabs/puppet/node_manager.yaml` in the following format:\n\n```\nserver: master.puppetlabs.vm             # Defaults to $settings::server\nport: 4433                               # Defaults to 4433\n# Supply certs\nhostcert: /root/certs/client.pem\nhostprivkey: /root/certs/client_key.pem\nlocalcacert: /root/certs/ca.pem\n# Or token\ntoken: AJLqDQxalbVSMWrZcX03aGtixvk_S2xGZfQizY9YvzVk\n```\n\n_NOTE:_ The token will be favored if both SSL and a token is provided.\n\n## Types\n\n### Node_group\n\nNode_groups will autorequire parent node_groups.\n\nEnumerate all node groups:\n\n* `puppet resource node_group`\n\nExample output for `puppet resource node_group 'PE MCollective'`\n\n```puppet\nnode_group { 'PE MCollective':\n  ensure               =\u003e 'present',\n  classes              =\u003e {'puppet_enterprise::profile::mcollective::agent' =\u003e {}},\n  environment          =\u003e 'production',\n  id                   =\u003e '4cdec347-20c6-46d7-9658-7189c1537ae9',\n  override_environment =\u003e 'false',\n  parent               =\u003e 'PE Infrastructure',\n  rule                 =\u003e ['and', ['~', ['fact', 'pe_version'], '.+']],\n}\n```\n\n#### Node_group parameters\n\n* `description`\n\n  Description of the node_group.\n\n* `classes`\n\n  Classes that are assigned to the node in hash format. Elements of the hash are class parameters.\n\n  Default (empty hash): `{}`\n\n* `environment`\n\n  Environment selected for this node group.\n\n  Default: `production`\n\n* `name`\n\n  (namevar) Node group's name.\n\n* `id`\n\n  Universal ID for the group. This attribute is read-only.\n\n* `override_environment`\n\n  Whether or not this group's environment ment setting overrides all other other environments.\n\n  Default: `false`\n\n* `parent`\n\n  The UID for the data group. Can be specified by group name or UID.\n\n  Default: `All Nodes`\n\n* `rules`\n\n  An array of classification rules.  To submit an empty ruleset, use `''` as your value.\n\n  Default (empty array): `[]`\n\n* `variables`\n\n  Global variables for the node group expressed in a hash as `{ 'var' =\u003e 'value' }`.\n\n  Default (empty hash): `{}`\n\n* `data`\n\n  Configuration data supplied for automatic parameter lookup for the group. \nData for the node group expressed in a hash as `{ 'class' =\u003e { 'param' =\u003e 'value' }}`.\nThis parameter is supported for PE \u003e=2017.3.x.\n\n  Default (empty hash): `{}`\n\n* `purge_behavior`\n\n  Defines how purging of classification, data and rules will be handled. By default, or when set to `all`, the node\\_group resource will ensure classes, data and rules are matched exactly, and remove any values not described by the resource. When set to `none`, the node\\_group resource will ensure data, classes and rules described are present with the prescribed values, but will not remove other classification, or other data, present in the node group. The `data` setting purges only data values, the `classes` setting purges only classes values and the `rule` setting purges only rule values. In case of conflict with the node classifiers `Nodes must match all rules.` and `Nodes may match any rule.` radio buttons. The node classifier takes precedence over defined node_group code.\n\n  Default: `all`\n\n  Values: `all`, `data`, `classes`, `rule`, `none`\n\n## Tasks\n\n### update_classes\n\nTrigger update-classes job\n\n```shell\npuppet task run node_manager::update_classes --nodes 'pe-master' environment=production\n\n```\n\n__NOTE__: Default environment value is `production`.\n\n## Functions\n\n### node_groups()\n\nRetrieve all or one node_group and its data.\n\n`node_groups()` will return:\n\n```puppet\n{\n  \"All Nodes\"=\u003e{\n    \"environment_trumps\"=\u003efalse,\n    \"parent\"=\u003e\"00000000-0000-4000-8000-000000000000\",\n    \"name\"=\u003e\"All Nodes\",\n    \"rule\"=\u003e[\"and\", [\"~\", \"name\", \".*\"]],\n    \"variables\"=\u003e{}, \"id\"=\u003e\"00000000-0000-4000-8000-000000000000\",\n    \"environment\"=\u003e\"production\",\n    \"classes\"=\u003e{},\n    \"config_data\"=\u003e{}\n  },\n  \"Production environment\"=\u003e{\n    \"environment_trumps\"=\u003efalse,\n    \"parent\"=\u003e\"00000000-0000-4000-8000-000000000000\",\n    \"name\"=\u003e\"Production environment\",\n    \"rule\"=\u003e[\"and\", [\"~\", \"name\", \".*\"]],\n    \"variables\"=\u003e{},\n    \"id\"=\u003e\"7233f964-951e-4a7f-88ea-72676ed3104d\",\n    \"environment\"=\u003e\"production\",\n    \"classes\"=\u003e{},\n    \"config_data\"=\u003e{}\n  },\n  ...\n}\n```\n\n`node_groups('All Nodes')` will return:\n\n```puppet\n{\n  \"All Nodes\"=\u003e{\n    \"environment_trumps\"=\u003efalse,\n    \"parent\"=\u003e\"00000000-0000-4000-8000-000000000000\",\n    \"name\"=\u003e\"All Nodes\",\n    \"rule\"=\u003e[\"and\", [\"~\", \"name\", \".*\"]],\n    \"variables\"=\u003e{}, \"id\"=\u003e\"00000000-0000-4000-8000-000000000000\",\n    \"environment\"=\u003e\"production\",\n    \"classes\"=\u003e{},\n    \"config_data\"=\u003e{}\n  }\n}\n  ```\n\n_Type:_ rvalue\n\n### get_nodes()\n\nRetrieve historical info about a node's check-ins and classification, if check-in storage is enabled.\n\n`get_nodes(nodename)` will return:\n\n```puppet\n{\n  \"name\": \"Deep Space 9\",\n  \"check_ins\": [\n    {\n      \"time\": \"2369-01-04T03:00:00Z\",\n      \"explanation\": {\n        \"53029cf7-2070-4539-87f5-9fc754a0f041\": {\n          \"value\": true,\n          \"form\": [\n            \"and\",\n            {\n              \"value\": true,\n              \"form\": [\"\u003e=\", {\"path\": [\"fact\", \"pressure hulls\"], \"value\": \"3\"}, \"1\"]\n            },\n            {\n              \"value\": true,\n              \"form\": [\"=\", {\"path\": [\"fact\", \"warp cores\"], \"value\": \"0\"}, \"0\"]\n            },\n            {\n              \"value\": true,\n              \"form\": [\"\u003e\" {\"path\": [\"fact\", \"docking ports\"], \"value\": \"18\"}, \"9\"]\n            }\n          ]\n        }\n      }\n    }\n  ],\n  \"transaction_uuid\": \"d3653a4a-4ebe-426e-a04d-dbebec00e97f\"\n}\n```\n\n`get_nodes()` (without the nodename argument) is deprecated, but is included for coverage of the API.  It\nwill return the same structure, but for all nodes with their historical check-in information.\n\n_Type:_ rvalue\n\n## Face\n\nThe `node_manager` face allows you to interact with endpoints other than\nthe groups endpoint using the type or function. Use the `--help` flag\nto explore functionaliy of each action.\n\n```\n# puppet node_manager --help\n\nUSAGE: puppet node_manager \u003caction\u003e\n\nInteract with node classifier API\n\nOPTIONS:\n  --render-as FORMAT             - The rendering format to use.\n  --verbose                      - Whether to log verbosely.\n  --debug                        - Whether to log debug information.\n\nACTIONS:\n  classes         List class information\n  classified      List classification information\n  environments    Query environment sync status\n  groups          List group information\n  pin             Pin a node to a group\n  unpin           Unpin a node from groups\n\nSee 'puppet man node_manager' or 'man puppet-node_manager' for full help.\n```\n\n## Things to do\n\n* Nothing at the moment\n\n## Experimental\n\nNew puppet-less provider with bash [here](scripts/README.md)\n\n## Maintainers\n\nThis repositority is largely the work of some Puppet community members.\nIt is not officially maintained by Puppet, or any individual in\nparticular. Issues should be opened in Github. Questions should be directed\nat the individuals responsible for committing that particular code.\n\n## Transfer notice\n\nThis module was previously maintained by [Ranjit Viswakumar](https://github.com/WhatsARanjit). It was migrated to Puppet/Perforce in 2024.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fpuppetlabs-node_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuppetlabs%2Fpuppetlabs-node_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fpuppetlabs-node_manager/lists"}