Hi,

The simplest I can think of would be to set up '$yy' as a parameter, and 
then pass that one down from install.pp
However, looking at this limited code snippet, perhaps you shouldn't even 
have a define in the install.pp, but a class that inherits from 'foo'.
Then you can access the $yy variable like this: $localvariable = $::foo::yy

Best regards,
Steven

On Monday, November 17, 2014 9:06:25 AM UTC+1, Rajgourav Jain wrote:
>
> Hi,
>
> I have written two defined type and trying to use some variables between 
> them. 
>
> ----foo/manifest/init.pp ------------
> define foo( $x=undef, $y=undef)
> {
>
>   if $x == undef {
>    $xx = $defualt_x
>   } else {
>     $xx  = $x
>   }
>
> if $y == undef {
>    $yy $defualt_y
>   } else {
>     $yy= $y
>   }
>
>  fooinstall {$xx:}
> }
>
>
> --------------foo/manifest/install.pp------------------- 
> define foo::install (){
>   if  $yy= "some text" 
>   { 
>      puppet code here
>    }
>   else {
>      puppet code here 
>   }
> }
>
>
> ------ sites.pp ----
> node 'hostnam-l.domain.com'
> {
> foo { "Aname" :
>    $x => a,
>    $y => b,
>  }
> }
>
> Could you suggest how can I make this code work. I am not able to access 
> $xx and $yy in defined type foo::install.
>
> Thanks,
> Rajgourav Jain
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/87d3848b-10cc-4ebb-912a-ba24293bb88d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to