Open kreeuwijk opened 3 years ago
I experience similar issue in PE2019, environmental group is not idempotent:
node_group { 'All Environments':
ensure => 'present',
description => 'Environment group parent and default',
environment => 'default_production',
override_environment => 'true',
parent => 'All Nodes',
rule => ['and',['~', 'name', '.*']],
}
# puppet apply env.pp
Notice: Compiled catalog for primary.localdomain in environment production in 0.02 seconds
Notice: /Stage[main]/Main/Node_group[All Environments]/override_environment: override_environment changed 'true' to true
Notice: Applied catalog in 0.43 seconds
Using Node Manager with PE 2021 usually works, but creating a not rule with != or with !~ causes a schema error. For example: ["!=", ["fact", "key"], "value"]
causes:
Error: node_manager failed with error type 'schema-violation': The object(s) in your submitted request did not conform to the schema. The problem is: ([:rule [nil nil (not (some-matching-condition? a-clojure.lang.PersistentVector))]])
My understanding was the RAL always prints Booleans as Strings?
# puppet resource service puppet
service { 'puppet':
ensure => 'stopped',
enable => 'false',
provider => 'launchd',
}
If there's a way to enforce a Boolean, I'd be happy to look at an example. I have marked this property as a Boolean here: https://github.com/WhatsARanjit/puppet-node_manager/blob/master/lib/puppet/type/node_group.rb#L21
I almost feel like that may be the problem. No matter whether we put 'true'
or true
as the value, we get a corrective change like:
/Stage[main]/Profile::Puppet::Classifier/Node_group[Agent-Specified Environment]/override_environment: override_environment changed 'true' to true (corrective)
I would prefer it was treated as a boolean, but apparently whatever is returning the current value is thinking it is a string?
this was probably fixed by #67, any chance for a new release, @WhatsARanjit ? thanks
@WhatsARanjit may we have a new forge release pls? 😃
When using
puppet resource node_group
to generate Puppet code for existing node groups, creating node groups on PE 2021 from this code fails due to 2 schema violations:override_environment
is represented as a string ('true'
or'false'
) instead of a boolean (true
orfalse
)rule
is represented as['']
if the node group has no rules and no pinned membersEither issue causes the Puppet run to fail with:
node_manager failed with error type 'schema-violation': The object(s) in your submitted request did not conform to the schema. The problem is: ([:rule "The rule is malformed. Please consult the group documentation for details on the rule grammar."])
Manual modification is currently needed to convert the string values to booleans, and to remove any occurrence of
rule => ['']
.Desired behavior:
puppet resource node_group
should print booleans foroverride_environment
puppet resource node_group
should omit therule
property entirely if its value would be['']
.