Ask Your Question

Custom Type with Property 'site' Fails 'puppet parser validate <manifest>

asked 2017-03-02 18:57:35 -0600

ross.murray gravatar image

updated 2017-03-05 16:29:07 -0600

Runtime environment: puppetversion=4.8.1, rubyversion=2.1.9 Type/Provider:

I have developed my own Custom Type and Provider for use with IIS. One of the Custom Types is 'iisapp', which has the param/namevar physicalpath, as well as properties apppool and site. On the command line, running 'puppet resource iis_app mytestapp ensure=present physicalpath=d:/inetpub/content/mytestsite/mytestapp site=mytestsite' works beautifully. However when I put this into a manifest and run 'puppet parser validate <manifest>' I encounter an the following error on the property 'site':

  iis_app { 'D:/inetpub/content/mytestsite/mytestapp' : 
    site       => 'mytestapp',
    ensure     => 'present',
    app_pool   => 'mytestpool',

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
Server Error: Evaluation Error: Error while evaluating a Resource Statement, Syntax error at 'site' at /etc/puppetlabs/code/environments/preprod/site/profile/manifests/<manifest>.pp:48:5 on node <nodename>
Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

I've found that because the puppet parser doesn't check to see if those params and properties are actually valid, that if I change it to the following, it will parse just fine:

  iis_app { 'D:/inetpub/content/mytestsite/mytestapp' : 
    totallynotaproperty  => 'mytestapp',
    ensure               => 'present',
    app_pool             => 'mytestpool',

And so the issue appears to be with the puppet parser and the property 'site'. However I can't find any reference to it as a reserved word or such.

Interestingly, I found this website that will syntax-check your code for you, and if I paste the above resource in and check it, even that finds issue with the word 'site'. Changing that line to "psite => 'mytestapp'," parses fine however.

I can see several other IIS modules that use 'site' without issue so really unsure as to where my fault may be.

edit retag flag offensive close merge delete


would you mind showing your type and provider? so that I can check whats wrong.

Hyder gravatar imageHyder ( 2017-03-02 22:19:35 -0600 )edit
ross.murray gravatar imageross.murray ( 2017-03-05 16:28:35 -0600 )edit

My point though is that the puppet parser wont accept it - the parser doesn't look at the type/provider it just checks syntax.

ross.murray gravatar imageross.murray ( 2017-03-05 16:42:49 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-05 19:18:32 -0600

ross.murray gravatar image

Received a response to this on the slack channel by binford2k. Apparently 'site' is a reserved keyword, but has yet to be added to the reserved words documentation. There is a job in for this to be amended.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-03-02 18:57:35 -0600

Seen: 68 times

Last updated: Mar 05 '17