Ask Your Question
0

Mysql_grant resource name must match user and table parameters. Why does "puppet parser validate" not check it?

asked 2015-03-02 19:33:09 -0500

narad gravatar image

updated 2015-03-04 19:26:32 -0500

GregLarkin gravatar image

I took the learning VM tutorial. I was intrigued by the naming of the Mysqlgrant resource, and wondered if it has any significance, so I modified it to "agrant_rule".

I checked my site.pp using "puppet parser validate" and got no errors whatsoever.

However, when I tried to apply this change, I got the following message:

Error: Failed to apply catalog: Validation of Mysql_grant[a_grant_rule] failed: name must match user and table parameters at /etc/puppetlabs/puppet/environments/production/manifests/site.pp:69
Wrapped exception:
name must match user and table parameters
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-03-04 19:32:44 -0500

GregLarkin gravatar image

puppet parser validate simply checks if the .pp file in question will pass a syntax check and nothing more. At the lowest level, it's checking to make sure that every token in the file is valid and conforms to the Puppet language specification.

For instance, this will pass the parser validation, but we have no idea if it's going to compile correctly:

class craziness {
  unknown { 'will this work?':
    happy      => 'yes',
    shouldwork => 'i hope',
    woops      => 'probably not',
  }
}

It might compile, if you have a resource type named unknown with the specified parameters, etc., etc. Now, notice that this similar example will not pass parser validation:

class craziness {
  unknown { 'will this work?':
    happy      => 'yes',
    shouldwork => 'i hope'
    woops      => 'probably not',
  }
}

Do you see the difference? Adding a version control repository pre-commit hook to execute puppet parser validate on your to-be-committed changes will ensure that nothing syntactically incorrect is checked in, but nothing more.

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

Stats

Asked: 2015-03-02 19:33:09 -0500

Seen: 509 times

Last updated: Mar 04 '15