Details
Description
It is currently not possible to collect resources using an abstract resource collector. There are two way that you can attempt to collect an abstract resource, and they both fail with compiler errors:
```
Resource[$type] <| tag == 'some_tag' |> -> Package['some_package']
```
This fails with a syntax error `Could not parse for environment root: Illegal expression. A '[]' expression is unacceptable as type name in a Virtual Query`.
I also tried:
```
Resource <| tag == 'some_tag' |> -> Package['some_package']
```
This causes an error:
```
Puppet::PreformattedError:
Evaluation Error: Error while evaluating a Virtual Query, Resource type resource doesn't exist
```
The example code I used that prompted this finding is here:
class gitlab::omnibus_package_repository ( |
Hash $repository_configuration,
|
Boolean $manage_omnibus_repository,
|
) {
|
if $manage_omnibus_repository { |
$repository_configuration.each() | String $resource_type, Hash $resources | {
|
create_resources($resource_type, $resources, {tag => 'gitlab_omnibus_repository_resource'}) |
}
|
|
# ensure all repository configuration are in place before the gitlab omnibus package is installed |
Resource <| tag == 'gitlab_omnibus_repository_resource' |> -> Package['gitlab-omnibus'] |
}
|
}
|