puppetlabs / puppetlabs-node_manager

Create and manage PE node groups as resources.
Apache License 2.0
10 stars 21 forks source link

Booleans should not be quoted in puppet resource output #27

Closed ggeldenhuis closed 7 years ago

ggeldenhuis commented 7 years ago

Hi I am not a 100% sure if the problem is with the provider or somewhere else in the puppet eco system.

I have the following node group:

node_group { 'Package Management':
  ensure               => 'present',
  classes              => {'puppet_enterprise::profile::agent' => {'package_inventory_enabled' => 'true'}},
  environment          => 'production',
  id                   => 'a214ae7e-60d0-465d-92ba-0fd4ffacc3be',
  override_environment => 'false',
  parent               => 'All Nodes',
  rule                 => ['and', ['=', ['fact', 'kernel'], 'Linux']],
}

The above was created by running puppet resource node_group.

I modified the code to the following:

node_group { 'Package Management':
  ensure               => 'present',
  environment          => 'production',
  classes              => {'puppet_enterprise::profile::agent' => {'package_inventory_enabled' => 'true' }},
  parent               => 'All Nodes',
  rule                 => ['and', ['=', ['fact', 'kernel'], 'Linux']],
}

Which works but gives an error when you try to run puppet agent on the box. The reason is because the boolean value is quoted and then becomes a string.

If I do:

node_group { 'Package Management':
  ensure               => 'present',
  environment          => 'production',
  classes              => {'puppet_enterprise::profile::agent' => {'package_inventory_enabled' => true }},
  parent               => 'All Nodes',
  rule                 => ['and', ['=', ['fact', 'kernel'], 'Linux']],
}

Then it works.

So the bug is that the boolean is quoted when running puppet resource and it should not be.

WhatsARanjit commented 7 years ago

Yeah unfortunately, this is a problem with puppet resource overall.

https://tickets.puppetlabs.com/browse/PUP-4078