The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:
parseonly fails when using custom types
|Affected Puppet version:||0.24.4||Branch:|
|Keywords:||parseonly, custom types|
Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com
If I have cutom types, like the mysql type from DavidS and use them in manifests, the manifests will fail with the parseonly option.
It seems obvious that puppet can’t know anything from your own types and therefor the type is unknown to it. However if you’d like to use parseonly as a sytax checker, this behaviour is obviously not that cool. On the otherside for a complete syntax check parseonly should fail on unknown types.
Maybe this problem could be “solved” by adding a —ignoreunknowntypes option to the —parseonly option, like the —ignoreimports option. A better, but I think more complicated, solution would be to have an additional option to pass additional (module) directories to the —parseonly option, where the custom types can be looked up.
We’d like to use the parseonly option for syntax checking while checking in, however as we use custom types we can’t currently use it.
#2 Updated by James Turnbull almost 8 years ago
- Status changed from Needs More Information to Accepted
puppet —parseonly —debug —trace manifests/munin.pp 06:19:33 < duritong> err: Could not parse for environment development: Unknown function
mysql_password at /home/mh/immerda/git/puppet/modules/mysql/manifests/munin.pp:9
#3 Updated by Peter Meier almost 8 years ago
a way to reproduce it:
$ git clone git://github.com/duritong/puppet-mysql.git $ cd puppet-mysql/ $ puppet --parseonly --trace manifests/munin.pp err: Could not parse for environment development: Unknown function mysql_password at /tmp/puppet-mysql/manifests/munin.pp:9
mysql_password is defined as a custom function. However it will also fail with custom types.
#4 Updated by Kelsey Hightower almost 4 years ago
- Description updated (diff)
Ok, so better late than never :)
The ablility to validate manifests using custom types seems to be fixed in atleast Puppet 2.7.x:
$ git clone git://github.com/duritong/puppet-mysql.git $ cd puppet-mysql/ $ puppet parser validate manifests/server/munin/default.pp