Describe the Bug
In manifests/manage.pp line 107, the file (and concat::fragment) branch declares resources using a String variable as the resource type:
$type { $title:
* => $attributes - 'erb' - 'epp' - 'content',
content => $content,
}
Puppet rejects this with:
Evaluation Error: Illegal Resource Type expression, expected result to be a type name, or untitled Resource, got String
The default branch already handles this correctly via create_resources(), but the file/concat::fragment branch does not.
Expected Behavior
Defining a file resource via stdlib::manage::create_resources in Hiera (e.g. stdlib::manage::create_resources: file: ...) should successfully create the resource without a catalog compilation error.
Steps to Reproduce
- Upgrade puppetlabs-stdlib to 10.0.0
- Add a stdlib::manage::create_resources entry with type file in node Hiera:
stdlib::manage::create_resources:
file:
'blocklist.acl':
content: |
1.2.3.4
5.6.7.8
mode: '0644'
- Run puppet agent on that node
Environment
- Version: 10.0.0
- Platform: Ubuntu 24.04
Additional Context
The default branch on line 113 uses create_resources($type, { $title => $attributes }) and works correctly. The file/concat::fragment branch should do the same, passing the computed $content merged into the attributes hash rather than using a dynamic resource type expression.
Claude provided me with this proposed diff. My environment doesn't have instances of stdlib::manage::create_resources using epp or erb files to test with so I'm not submitting a PR.
--- a/manifests/manage.pp
+++ b/manifests/manage.pp
@@ -104,9 +104,7 @@ class stdlib::manage (
} else {
$content = undef
}
- $type { $title:
- * => $attributes - 'erb' - 'epp' - 'content',
- content => $content,
- }
+ create_resources($type, { $title => $attributes - 'erb' - 'epp' - 'content' + { 'content' => $content } })
}
default: {
create_resources($type, { $title => $attributes })
Describe the Bug
In manifests/manage.pp line 107, the file (and concat::fragment) branch declares resources using a String variable as the resource type:
$type { $title:
* => $attributes - 'erb' - 'epp' - 'content',
content => $content,
}
Puppet rejects this with:
Evaluation Error: Illegal Resource Type expression, expected result to be a type name, or untitled Resource, got String
The default branch already handles this correctly via create_resources(), but the file/concat::fragment branch does not.
Expected Behavior
Defining a file resource via stdlib::manage::create_resources in Hiera (e.g. stdlib::manage::create_resources: file: ...) should successfully create the resource without a catalog compilation error.
Steps to Reproduce
Environment
Additional Context
The default branch on line 113 uses create_resources($type, { $title => $attributes }) and works correctly. The file/concat::fragment branch should do the same, passing the computed $content merged into the attributes hash rather than using a dynamic resource type expression.
Claude provided me with this proposed diff. My environment doesn't have instances of stdlib::manage::create_resources using epp or erb files to test with so I'm not submitting a PR.