The documentation is behind. The `type` keyword has been operational in
3.x when used with future parser since some time as well as in puppet 4.x.
> *1. Puppet version (Windows 7):*
>
> C:\>puppet --version
> 4.2.1
>
> *2. puppetlabs/stdlib version*
>
> C:\>puppet module list --modulepath=c:\git\winpuppet\test\modules
> c:/git/winpuppet/test/modules
> +-- mymodule (???)
> +-- puppetlabs-stdlib (v4.14.0)
>
> *3. Manifest (%MODULEPATH%\mymodule\manifests\mymanifest.pp):*
>
> |
> classmymodule::mymanifest (
> String$string_param ='a string',
> Stdlib::Windowspath$windowspath_param ='C:\a\valid\path'){
>
> notice($string_param)
> notice($windowspath_param)
>
> }
> |
>
> *4. Execution/error message:*
>
> C:\>puppet apply --modulepath=c:\git\winpuppet\test\modules -e "include
> mymodule::mymanifest"
> Error: Evaluation Error: Error while evaluating a Function Call,
> Expected parameter 'windowspath_param' of 'Class[Mymodule::Mymanifest]'
> to have type Stdlib::Windowspath, got String at line 1:1 on node
> xxx.yyy.zzz
>
> If, instead, I use a nonexistent type in the manifest, such as
> "My_nonexistent_type", I got the same error message:
>
> C:\>puppet apply --modulepath=c:\git\winpuppet\test\modules -e "include
> mymodule::mymanifest"
> Error: Evaluation Error: Error while evaluating a Function Call,
> Expected parameter 'windowspath_param' of 'Class[Mymodule::Mymanifest]'
> to have type My_nonexistent_type, got String at line 1:1 on node
> xxx.yyy.zzz
>
A non-existent type will in some versions of puppet be taken as being a
resource type.
One thing you can check is that your module (where you are using
Stdlib::XXX types have declared a dependency on Stdlib in its metadata.
If it does not have this it will not find types in Stdlib.
Regards
- henrik
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/