On Thu, Jan 31, 2013 at 5:52 PM, Gavin Williams <[email protected]> wrote:
> Afternoon all
>
> I'm sure this is probably a nice n easy one, but I can't work it out for the
> life of me...
>
> Anyhow, I've got the following code:
>   # Load db yaml data
>   $db_details = loadyaml('/etc/puppet/data/databases.yaml')
>
>   notify{"DB Details loaded... About to parse.":}
>   ->
>   notify{"DB Details = ${db_details}.":}
>
>   #$hostname = lookupvar('{hostname}')
>   # Parse data and filter to only primary databses for this server
>   $databases = parse_databases($db_details, 'database_primay_server',
> $::hostname)
>
>   notify{"Parsed db details, creating resources.":}
>   ->
>   notify{"Databases = ${databases}":}
>
>   # Create required resources...
>   if $::oracle_netapp {
>     notify{"\$::oracle_netapp is true.":}
>     create_resources( act::env::oracle::instance::netapp, $databases)
>   }
>
> Parse_databases() is a custom function within one of my modules..

And I assume that the module that defines/declares parse_databases()
is 'include'd just above this snippet?  Not that I'm sure it will
change things.  If not...

As $db_details is only used by the parse_databases() function (in this
snippet), is it possible to move the call to loadyaml() within the
function itself?  I've assumed you need $db_details further on outside
of the code you showed here, but thought I'd suggest the bleeding
obvious, just in case :-)

Thanks,

Matt.

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


Reply via email to