Luke

Cheers for the reply. 

Firstly, apologies, I could've swore I put an example config stanza in my 
post... 
Anyways, the config looks like:
# Instance: DBTEST01 <-- Header line that I've added to try and group 
configs
server: stgasm <=== NFS server Host name
path: 10.177.52.158 <--- First path to NFS server ie NFS server NIC
local: 10.177.52.151 <--- First client-side NIC
path: 10.177.52.159 <--- Second path to NFS server ie NFS server NIC (For 
load balance purpose) # Optional
local: 10.177.52.151 <--- Second client-side NIC (For load balance purpose) 
# Optional
export: /oradata mount: /oradata <-- One or more of these lines, with 
different values... 
export: /oraredo mount: /oraredo

These blocks are going to be repeated multiple times for each DB configured 
on a given host...

I've just pushed an updated code set to 
https://github.com/fatmcgav/puppet-oracle/commits/oranfstab_dev

Thoughts before I plow on too much further? 

Cheers
Gavin 

On Friday, 25 January 2013 17:15:19 UTC, Luke Kanies wrote:
>
> On Jan 24, 2013, at 8:10 AM, Gavin Williams <[email protected]<javascript:>> 
> wrote:
>
> 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? 
>
>
> Hi Gavin,
>
> The short answer is that I recommend doing your best not to see the cron 
> provider as a good example of anything.  It's always been less stable than 
> I would like, and it's just a bit painful overall.
>
> Cron is especially painful because cron records aren't necessarily unique, 
> they don't have a name-like field, and every single field except command is 
> optional, but if they're not filled in they get a '*'.  Hopefully your file 
> isn't like that.
>
> What is the actual format you're trying to generate?
>
> The first problem, though, is that you don't have a record_line call in 
> your tab.  Look at the oratab provider - it has a single record_line call 
> that defines what a single line's record looks like.  You should generally 
> not use text_line for anything other than something you want to duplicate 
> exactly in a file.  The cron provider treats environment specially, even 
> though it's a text_line, because, again, the cron format absolutely sucks.
>
> Try adding a record_line and see where that gets you.
>
> -- 
> Luke Kanies | http://about.me/lak | http://puppetlabs.com/ | 
> +1-615-594-8199
>  
>

-- 
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