Manipulate node_groups from a system without Puppet installed.
[root@server ~/node_manager/scripts]# ./node_group.sh -n 'Example Group' \
--rule '["or", ["=", "name", "node.whatsaranjit.com"]]' \
--classes '{"vim": {}}' --variables '{"foo": "bar"}'
New group ID: 15e0c815-e3ca-48e3-a467-e86e5b9d025e
Place a file at ~/.node_managerrc
following this example:
MASTER=master.whatsaranjit.com # Defaults to hostname -f
PORT=4433 # Defaults to 4433
TOKEN='<your_token>'
Usage: ./node_group.sh [options] [UID]
-n| --name The name of the node_group.
*Required to create a new group.
-x| --ensure Set to [present|absent] for existence.
Default: present
-d| --description Description of group.
-e| --environment Puppet environment for group.
Default: production
-o| --override Set to [true|false] for environment group.
Default: false
-p| --parent Parent group UID.
Default: 00000000-0000-4000-8000-000000000000
-c| --classes Hash of classes and parameters.
Example: '{ "vim": {} }'
-r| --rule Array of rules for matching.
Example: '["or", ["=", "name", "node.whatsaranjit.com"]]'
-v| --variables Variables to set in the group.
Example: '{ "foo": "bar" }'
-a| --config_data Configuration data for the group.
Example: '{ "vim": { "vim_package": "vim-common" } }'
-h| --help Display this help message.
[root@server ~/node_manager/scripts]# ./node_group.sh -n 'Example Group'
The --name
flag is required. All other flags are optional.
[root@server ~/node_manager/scripts]# ./node_group.sh -d 'New description' 15e0c815-e3ca-48e3-a467-e86e5b9d025e
You must edit a group by giving the UID.
[root@server ~/node_manager/scripts]# ./node_group.sh --ensure absent 15e0c815-e3ca-48e3-a467-e86e5b9d025e
You must delete a group by giving the UID.