Afternoon all

Firstly, apologies for posting this directly to the Puppet-dev group, 
however I thought I'd probably get a better response here versus the 
Puppet-users group... 

I'm trying to get my head around Parsedfile providers in Puppet. 
The intention is create a new type/provider for processing the oranfstab 
file, in a similar manner to oratab<https://github.com/fatmcgav/puppet-oracle>. 
I've been having a look at the crontab 
provider<https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/cron/crontab.rb>,
 
trying to digest how it functions, as the oranfstab is a fair amount more 
complex than the standard oratab file... 

I've stuck the first stab of my code 
here<https://github.com/fatmcgav/puppet-oracle/commit/cc7f37f30c168255fd130abe3f7052a3068553b9>.
 


The type works fine if I run it just with a name:
$ sudo puppet apply -e 'oranfstab { DBTEST01: ensure => present, }'
/Stage[main]//Oranfstab[DBTEST01]/ensure: created
Finished catalog run in 0.23 seconds

$ sudo cat /etc/oranfstab
# HEADER: This file was autogenerated at Thu Jan 24 16:04:53 +0000 2013 by 
puppet.
# HEADER: While it can still be managed manually, it is definitely not 
recommended.
# HEADER: Note particularly that the comments starting with '#' should
# HEADER: not be deleted, as doing so could cause duplicate database 
entries.
# Instance: DBTEST01

However if I try and add the nfsserver option, it fails as follows:
$ sudo puppet apply -e 'oranfstab { DBTEST01: ensure => present, nfsserver 
=> 'act-star-nactl01' }'
/Stage[main]//Oranfstab[DBTEST01]/ensure: created
Error: /Stage[main]//Oranfstab[DBTEST01]: Could not evaluate: undefined 
local variable or method `nfsserver' for 
#<Puppet::Util::FileParsing::FileRecord:0x7f0659233870>
Finished catalog run in 0.23 seconds

What I'm struggling to get my head around is how should the nfsserver 
method be setup in the parsed.rb???
Looking at the crontab type/provider, there are several properties in the 
type that don't have a corresponding method in the provider... :environment 
for example... 

Any ideas/pointers? 

Thank you in advance for any responses. 

Regards
Gavin 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to