TL;DR FR: looks good! When a code-id-command script is provided, the server correctly inlines file metadata by default.
Verified (using puppet-agent build 9d6ed6fb9ff96306d4737c9f148d48a4e362fbcf) that the static_catalogs setting defaults to true:
[root@yrsprbv3x8dxzvg ~]# puppet config print static_catalogs
|
true
|
All tests below use the following manifests / files:
Manifest:
cat site.pp
|
|
node default {
|
file { '/tmp/test':
|
ensure => file,
|
source => 'puppet:///modules/foo/test.txt',
|
}
|
}
|
|
cat text.txt
|
Module 'foo' file content
|
When no code-id-command script is present on the server, we don't expect to compile static catalogs:
After the run, the 'tmp/test' file resource in the catalog looks like:
{
|
"type":"File",
|
"title":"/tmp/test",
|
"tags":[
|
"file",
|
"node",
|
"default",
|
"class"
|
],
|
"file":"/etc/puppetlabs/code/environments/production/manifests/site.pp",
|
"line":2,
|
"exported":false,
|
"parameters":{
|
"ensure":"file",
|
"source":"puppet:///modules/foo/test.txt"
|
}
|
}
|
... and code_id is null, as expected.
And the server logs do not show that a static catalog was compiled.
When a code-id-command script is provided, we expect static catalogs to be compiled:
code-id script:
#! /bin/bash
|
|
echo 'code-id'
|
When the agent is run, the server logs show:
2016-02-18 11:47:43,389 INFO [qtp1007017058-27] [puppet-server] Puppet Compiled static catalog for yrsprbv3x8dxzvg.delivery.puppetlabs.net in environment production in 0.16 seconds
|
2016-02-18 11:47:43,399 INFO [qtp1007017058-27] [puppet-server] Puppet Inlined resource metadata into static catalog for yrsprbv3x8dxzvg.delivery.puppetlabs.net in environment production in 0.01 seconds
|
... and the catalog includes:
"code_id":"code-id"
|
...
|
{
|
"type":"File",
|
"title":"/tmp/test",
|
"tags":[
|
"file",
|
"node",
|
"default",
|
"class"
|
],
|
"file":"/etc/puppetlabs/code/environments/production/manifests/site.pp",
|
"line":2,
|
"exported":false,
|
"parameters":{
|
"ensure":"file",
|
"source":"puppet:///modules/foo/test.txt",
|
"checksum":"md5",
|
"checksum_value":"6ef7ddd2c689aaa739c47f346ceb564f"
|
}
|
}
|
|