Overview
puppet resource currently outputs quotes around values such as 'false' which should logically equate to true unless there are additional measures in place to parse out known values before continuing.
Problems this causes
As part of the preparation for PE 4.x which includes optional typing, we need to help educate users not to write code which is ambiguous or needs additional processing to work correctly.
It's important that the RAL tool generates good puppet code because:
-
Its often the first puppet code a user will see (output by installer)
-
Its output be used for reverse engineering systems and can end up becoming deeply embedded into a codebase
Worked example
Inspecting the pe-puppet service - note quoting around boolean (and reserved word?):
[root@xagent1 ~]# puppet resource service pe-puppet
|
service { 'pe-puppet':
|
ensure => 'running',
|
enable => 'true',
|
}
|
Change the pe-puppet daemon to be stopped with puppet resource -e service pe-puppet
Check output of puppet resource command again, note quoting as above
[root@xagent1 ~]# puppet resource service pe-puppet
|
service { 'pe-puppet':
|
ensure => 'stopped',
|
enable => 'false',
|
}
|
Corrective action
-
booleans should not be quoted
-
reserved words should not be quoted
|