Closed tkishel closed 5 years ago
Also, why is there no unpin from a specific group?
puppet node_manager unpin --node_group GROUP nodename
:)
@tkishel If it's not pinning, that's a bug I should look into.
As for unpinning, when I created the module, this didn't exist: https://puppet.com/docs/pe/2017.1/nc_groups.html#post-v1groupsidunpin
But now it does, so I'll work on adding it.
Thanks!!!
Ok, was able to pin a node successfully. One thing, using the face, which is a little more basic, you have to supply the group ID, not the group name. I did this so each ad-hoc command line action wouldn't run the instances()
method and query all groups first. That said, there was still a bug in there anyway. Here's the code so far.
https://github.com/WhatsARanjit/puppet-node_manager/tree/issue44
# puppet resource node_group 'Pin Test' ensure=present
Notice: New node_group 'Pin Test' with ID 'c3094616-479b-4eef-980f-92c1805b2070'
Notice: /Node_group[Pin Test]/ensure: created
node_group { 'Pin Test':
ensure => 'present',
}
# puppet resource node_group 'Pin Test'
node_group { 'Pin Test':
ensure => 'present',
environment => 'production',
id => 'c3094616-479b-4eef-980f-92c1805b2070',
override_environment => 'false',
parent => 'All Nodes',
rule => [''],
}
# puppet node_manager pin --node_group 'c3094616-479b-4eef-980f-92c1805b2070' 'test.node'
# puppet resource node_group 'Pin Test'
node_group { 'Pin Test':
ensure => 'present',
environment => 'production',
id => 'c3094616-479b-4eef-980f-92c1805b2070',
override_environment => 'false',
parent => 'All Nodes',
rule => ['or', ['=', 'name', 'test.node']],
}
Alright, added a --all
option to the unpin
action.
# puppet node_manager unpin --help
USAGE: puppet node_manager unpin [--all] [--node_group GROUP] nodename
Unpin a node from a group
OPTIONS:
--render-as FORMAT - The rendering format to use.
--verbose - Whether to log verbosely.
--debug - Whether to log debug information.
--all - Unpin a node from all groups
--node_group GROUP - Node group to unpin from
See 'puppet man node_manager' or 'man puppet-node_manager' for full help.
This is a breaking change because previously, unpin
would unpin the node from all groups. Now it will only do all groups if --all
is supplied.
So --node_group
is an ID not a Name?
Merged.
puppet node_manager pin
does not pin or error, given ...Define a group:
Create the group:
Inspect the group (Confirmed in the Console):
Pin an existing node:
Inspect the group (Confirmed in the Console):