Hi Team . i am trying to use "Out-of-Scope Variables" trying to setup kind of like an "answer" file that would be global file for other modules to use .like 40 variables . and call the variables from template or manifest file . lets say i have module share_module/mainfest/init.pp $var1 = ''test1'' $var2 =''test2'' $ ........ i would like to use "share_module/mainfest/init.pp " from another module , lets say apache module/template/ssl.erb file witch some of the faribles there are the same in all my servers and some deffer and i would the answer file to be centralized place i can manage the vars . any pointers is much appreciated . Thank You Yaniv Fine -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Etsh3kPvHMcJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Comments in line. On Tuesday, July 17, 2012 8:24:46 AM UTC-5, Yaniv Fine wrote:> > > Hi Team . > > i am trying to use "Out-of-Scope Variables" > trying to setup kind of like an "answer" file that would be global file > for other modules to use .like 40 variables . > and call the variables from template or manifest file . > > lets say i have module share_module/mainfest/init.pp > $var1 = ''test1'' > $var2 =''test2'' > $ ........ > > > i would like to use "share_module/mainfest/init.pp " > > from another module , lets say apache module/template/ssl.erb file > witch some of the faribles there are the same in all my servers and some > deffer and i would the answer file to be centralized place i can manage the > vars . > >This can be done if you do something like scope.lookupvar(share_module::varname) in the ERB. Honestly though, I would use hiera for this, it''s cleaner. In the .pp calling the template you can do something like: $myvar = hiera(''test1'') then just reference myvar in the template as a normal variable. any pointers is much appreciated .> > > Thank You > Yaniv Fine > > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/xbGfZaxVlPoJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
thank you for the answer . i tried to use the " scope.lookupvar(share_module::varname)" in the erb file but got a blank line (empty value) i will have a look on hiera also , thank you On Tue, Jul 17, 2012 at 5:37 PM, llowder@oreillyauto.com < llowder@oreillyauto.com> wrote:> > Comments in line. > > On Tuesday, July 17, 2012 8:24:46 AM UTC-5, Yaniv Fine wrote: >> >> >> Hi Team . >> >> i am trying to use "Out-of-Scope Variables" >> trying to setup kind of like an "answer" file that would be global file >> for other modules to use .like 40 variables . >> and call the variables from template or manifest file . >> >> lets say i have module share_module/mainfest/init.pp >> $var1 = ''test1'' >> $var2 =''test2'' >> $ ........ >> >> >> i would like to use "share_module/mainfest/init.pp " >> >> from another module , lets say apache module/template/ssl.erb file >> witch some of the faribles there are the same in all my servers and some >> deffer and i would the answer file to be centralized place i can manage the >> vars . >> >> > This can be done if you do something like > > > scope.lookupvar(share_module::varname) > > in the ERB. > > > > Honestly though, I would use hiera for this, it''s cleaner. > > In the .pp calling the template you can do something like: > > $myvar = hiera(''test1'') > > then just reference myvar in the template as a normal variable. > > any pointers is much appreciated . >> >> >> Thank You >> Yaniv Fine >> >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/xbGfZaxVlPoJ. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
llowder@oreillyauto.com
2012-Jul-17 15:34 UTC
Re: [Puppet Users] Re: Out-of-Scope Variables
On Tuesday, July 17, 2012 10:16:56 AM UTC-5, Yaniv Fine wrote:> > thank you for the answer . > i tried to use the " > > scope.lookupvar(share_module::varname)" in the erb file > >Did you use ''<%'' or ''<%='' in the template? You also may need to add include ''share_module'' to the .pp but got a blank line (empty value)> i will have a look on hiera > > also , > thank you > > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/J7wTxTL3j58J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
I have used the <% and <%= but didn''t use the share_module On Jul 17, 2012 6:34 PM, "llowder@oreillyauto.com" <llowder@oreillyauto.com> wrote:> > > On Tuesday, July 17, 2012 10:16:56 AM UTC-5, Yaniv Fine wrote: >> >> thank you for the answer . >> i tried to use the " >> >> scope.lookupvar(share_module::**varname)" in the erb file >> >> > Did you use ''<%'' or ''<%='' in the template? > > You also may need to add include ''share_module'' to the .pp > > > but got a blank line (empty value) >> i will have a look on hiera >> >> also , >> thank you >> >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/J7wTxTL3j58J. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, On 07/17/2012 05:16 PM, Yaniv Fine wrote:> thank you for the answer . > i tried to use the " > > |scope.lookupvar(share_module::varname)" in the erb file > but got a blank line (empty value) > i will have a look on |hiera > > also , > thank youI''m fairly certain you need to quote the name of the variable you want to look up. scope.lookupvar("share_module::varname") HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Sorry . My mistake . I have used the share_module:varname On Jul 17, 2012 7:06 PM, "Felix Frank" <felix.frank@alumni.tu-berlin.de> wrote:> Hi, > > On 07/17/2012 05:16 PM, Yaniv Fine wrote: > > thank you for the answer . > > i tried to use the " > > > > |scope.lookupvar(share_module::varname)" in the erb file > > but got a blank line (empty value) > > i will have a look on |hiera > > > > also , > > thank you > > I''m fairly certain you need to quote the name of the variable you want > to look up. > > scope.lookupvar("share_module::varname") > > HTH, > Felix > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
i have tested this again today when i arrived to the office , with no luck .
when calling another module (sharedvar)/mainfest/generic.pp file from
within my template file .
******************
class sharedvar {
$vartest = ''test1''
}
******************
i use in my erb file in module/mymodule/templates/bla.erb
<%= scope.lookupvar(''sharedvar::vartest'') %>
i get a blank line without my test1 parameter
what am i doing wrong here .
i can workaround this by declaring the vars in the same module that i
want to use them but i want it to be cross module vars .
On Tue, Jul 17, 2012 at 7:09 PM, Yaniv Fine <yanivfine@gmail.com> wrote:
> Sorry .
> My mistake . I have used the share_module:varname
> On Jul 17, 2012 7:06 PM, "Felix Frank"
<felix.frank@alumni.tu-berlin.de>
> wrote:
>
>> Hi,
>>
>> On 07/17/2012 05:16 PM, Yaniv Fine wrote:
>> > thank you for the answer .
>> > i tried to use the "
>> >
>> > |scope.lookupvar(share_module::varname)" in the erb file
>> > but got a blank line (empty value)
>> > i will have a look on |hiera
>> >
>> > also ,
>> > thank you
>>
>> I''m fairly certain you need to quote the name of the variable
you want
>> to look up.
>>
>> scope.lookupvar("share_module::varname")
>>
>> HTH,
>> Felix
>>
>> --
>> You received this message because you are subscribed to the Google
Groups
>> "Puppet Users" group.
>> To post to this group, send email to puppet-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> puppet-users+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/puppet-users?hl=en.
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Make sure you include sharedvar class in your sharedvar::generic class before the template is called. On 18 July 2012 09:10, Yaniv Fine <yanivfine@gmail.com> wrote:> i have tested this again today when i arrived to the office , with no luck . > when calling another module (sharedvar)/mainfest/generic.pp file from within > my template file . > ****************** > class sharedvar { > $vartest = ''test1'' > } > ****************** > i use in my erb file in module/mymodule/templates/bla.erb > > <%= scope.lookupvar(''sharedvar::vartest'') %> > > > i get a blank line without my test1 parameter > > what am i doing wrong here . > > i can workaround this by declaring the vars in the same module that i want > to use them but i want it to be cross module vars . > > > > > > On Tue, Jul 17, 2012 at 7:09 PM, Yaniv Fine <yanivfine@gmail.com> wrote: >> >> Sorry . >> My mistake . I have used the share_module:varname >> >> On Jul 17, 2012 7:06 PM, "Felix Frank" <felix.frank@alumni.tu-berlin.de> >> wrote: >>> >>> Hi, >>> >>> On 07/17/2012 05:16 PM, Yaniv Fine wrote: >>> > thank you for the answer . >>> > i tried to use the " >>> > >>> > |scope.lookupvar(share_module::varname)" in the erb file >>> > but got a blank line (empty value) >>> > i will have a look on |hiera >>> > >>> > also , >>> > thank you >>> >>> I''m fairly certain you need to quote the name of the variable you want >>> to look up. >>> >>> scope.lookupvar("share_module::varname") >>> >>> HTH, >>> Felix >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Puppet Users" group. >>> To post to this group, send email to puppet-users@googlegroups.com. >>> To unsubscribe from this group, send email to >>> puppet-users+unsubscribe@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/puppet-users?hl=en. >>> > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- Erik Dalén -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 07/18/2012 09:47 AM, Erik Dalén wrote:> Make sure you include sharedvar class in your sharedvar::generic class > before the template is called.Right, but more succinctly: sharedvar::generic does not appear to be the caller, but rather some class in mymodule. The point is: The class that uses the template must include the sharedvar class. Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
i am missing something here .
those classes are from the same module .
i am calling sharedvar::vartest
class sharedvar {
$vartest = ''blabla
}''
from template file that reside on module "newmodule"
where do i put the include class and what syntax i use to call it ?
thank you :)
On Wed, Jul 18, 2012 at 10:47 AM, Erik Dalén
<erik.gustav.dalen@gmail.com>wrote:
> Make sure you include sharedvar class in your sharedvar::generic class
> before the template is called.
>
> On 18 July 2012 09:10, Yaniv Fine <yanivfine@gmail.com> wrote:
> > i have tested this again today when i arrived to the office , with no
> luck .
> > when calling another module (sharedvar)/mainfest/generic.pp file from
> within
> > my template file .
> > ******************
> > class sharedvar {
> > $vartest = ''test1''
> > }
> > ******************
> > i use in my erb file in module/mymodule/templates/bla.erb
> >
> > <%= scope.lookupvar(''sharedvar::vartest'') %>
> >
> >
> > i get a blank line without my test1 parameter
> >
> > what am i doing wrong here .
> >
> > i can workaround this by declaring the vars in the same module that i
> want
> > to use them but i want it to be cross module vars .
> >
> >
> >
> >
> >
> > On Tue, Jul 17, 2012 at 7:09 PM, Yaniv Fine
<yanivfine@gmail.com> wrote:
> >>
> >> Sorry .
> >> My mistake . I have used the share_module:varname
> >>
> >> On Jul 17, 2012 7:06 PM, "Felix Frank"
<felix.frank@alumni.tu-berlin.de
> >
> >> wrote:
> >>>
> >>> Hi,
> >>>
> >>> On 07/17/2012 05:16 PM, Yaniv Fine wrote:
> >>> > thank you for the answer .
> >>> > i tried to use the "
> >>> >
> >>> > |scope.lookupvar(share_module::varname)" in the erb
file
> >>> > but got a blank line (empty value)
> >>> > i will have a look on |hiera
> >>> >
> >>> > also ,
> >>> > thank you
> >>>
> >>> I''m fairly certain you need to quote the name of the
variable you want
> >>> to look up.
> >>>
> >>> scope.lookupvar("share_module::varname")
> >>>
> >>> HTH,
> >>> Felix
> >>>
> >>> --
> >>> You received this message because you are subscribed to the
Google
> Groups
> >>> "Puppet Users" group.
> >>> To post to this group, send email to
puppet-users@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> puppet-users+unsubscribe@googlegroups.com.
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/puppet-users?hl=en.
> >>>
> >
> > --
> > You received this message because you are subscribed to the Google
Groups
> > "Puppet Users" group.
> > To post to this group, send email to puppet-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > puppet-users+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/puppet-users?hl=en.
>
>
>
> --
> Erik Dalén
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
On 07/18/2012 10:31 AM, Yaniv Fine wrote:> i am missing something here . > those classes are from the same module . > i am calling sharedvar::vartest > class sharedvar { > $vartest = ''blabla > }'' > from template file that reside on module "newmodule" > > where do i put the include class and what syntax i use to call it ? > > thank you :)I presume you have a file { } somewhere that uses content => template(...). Where is that file declared? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
in "newmodule" pp file On Wed, Jul 18, 2012 at 11:39 AM, Felix Frank < felix.frank@alumni.tu-berlin.de> wrote:> On 07/18/2012 10:31 AM, Yaniv Fine wrote: > > i am missing something here . > > those classes are from the same module . > > i am calling sharedvar::vartest > > class sharedvar { > > $vartest = ''blabla > > }'' > > from template file that reside on module "newmodule" > > > > where do i put the include class and what syntax i use to call it ? > > > > thank you :) > > I presume you have a file { } somewhere that uses content => template(...). > > Where is that file declared? > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 07/18/2012 10:44 AM, Yaniv Fine wrote:> in "newmodule" pp file > > I presume you have a file { } somewhere that uses content => template(...). > > Where is that file declared?Let me rephrase that: What is the name of the class in which the file is defined? If it''s not inside a class, put it in one. Also "include sharedvar" in that class. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Frank .
let me put it all together :)
i have a module name "sharevar"
i have another module "newmodule"
inside "sharevar"/manifest/genreic.pp
class sharevar::generec {
$vartest = ''infooramtion''
}
i have newmodule/manifest/men.pp
that include the content => template path erb file
and i have the newmodule/templates/new.erb file
that i want to use value from ("sharevar"/manifest/genreic.pp)
the $vartest value
hope this helps
thank you for your effort .
On Wed, Jul 18, 2012 at 11:46 AM, Felix Frank <
felix.frank@alumni.tu-berlin.de> wrote:
> On 07/18/2012 10:44 AM, Yaniv Fine wrote:
> > in "newmodule" pp file
> >
> > I presume you have a file { } somewhere that uses content =>
> template(...).
> >
> > Where is that file declared?
>
> Let me rephrase that: What is the name of the class in which the file is
> defined? If it''s not inside a class, put it in one. Also
"include
> sharedvar" in that class.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
On 07/18/2012 11:03 AM, Yaniv Fine wrote:> Frank . > let me put it all together :) > > i have a module name "sharevar" > i have another module "newmodule" > inside "sharevar"/manifest/genreic.pp > class sharevar::generec { > $vartest = ''infooramtion'' > } > > i have newmodule/manifest/men.pp > that include the content => template path erb file > and i have the newmodule/templates/new.erb file > that i want to use value from ("sharevar"/manifest/genreic.pp) > the $vartest value > > hope this helpsNot really, sorry. Please share the content of newmodule/manifest/men.pp -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
----- Original Message -----> From: "Yaniv Fine" <yanivfine@gmail.com> > To: puppet-users@googlegroups.com > Sent: Wednesday, July 18, 2012 10:03:01 AM > Subject: Re: [Puppet Users] Re: Out-of-Scope Variables > > > Frank . > let me put it all together :) > > i have a module name "sharevar" > i have another module "newmodule" > inside "sharevar"/manifest/genreic.pp > class sharevar::generec { > $vartest = ''infooramtion'' > } > > i have newmodule/manifest/men.pp > that include the content => template path erb file > and i have the newmodule/templates/new.erb file > that i want to use value from ("sharevar"/manifest/genreic.pp) > the $vartest value > > hope this helps > > thank you for your effort .class sharevar { $vartest = "info" } class newmodule { # you have to include sharevar somewhere, can be in a node or anywhere else include sharevar # access the variable in another module in a .pp file notify{"vartest is ${sharevar::vartest}": } # access it in a template file{"/tmp/test": content => template("new.erb")} } new.erb: <%= scope.lookupvar("sharevar::vartest") %> -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
class newmodule::men {
file {''/tmp/bootstrap.properties'':
mode => ''644'',
owner => ''root'',
group => ''root'',
content => template(''newmodule/bootstrap.erb'')
}
}
On Wed, Jul 18, 2012 at 12:11 PM, Felix Frank <
felix.frank@alumni.tu-berlin.de> wrote:
>
>
> On 07/18/2012 11:03 AM, Yaniv Fine wrote:
> > Frank .
> > let me put it all together :)
> >
> > i have a module name "sharevar"
> > i have another module "newmodule"
> > inside "sharevar"/manifest/genreic.pp
> > class sharevar::generec {
> > $vartest = ''infooramtion''
> > }
> >
> > i have newmodule/manifest/men.pp
> > that include the content => template path erb file
> > and i have the newmodule/templates/new.erb file
> > that i want to use value from
("sharevar"/manifest/genreic.pp)
> > the $vartest value
> >
> > hope this helps
>
> Not really, sorry.
>
> Please share the content of newmodule/manifest/men.pp
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
i''ll try that . On Wed, Jul 18, 2012 at 12:12 PM, R.I.Pienaar <rip@devco.net> wrote:> > > ----- Original Message ----- > > From: "Yaniv Fine" <yanivfine@gmail.com> > > To: puppet-users@googlegroups.com > > Sent: Wednesday, July 18, 2012 10:03:01 AM > > Subject: Re: [Puppet Users] Re: Out-of-Scope Variables > > > > > > Frank . > > let me put it all together :) > > > > i have a module name "sharevar" > > i have another module "newmodule" > > inside "sharevar"/manifest/genreic.pp > > class sharevar::generec { > > $vartest = ''infooramtion'' > > } > > > > i have newmodule/manifest/men.pp > > that include the content => template path erb file > > and i have the newmodule/templates/new.erb file > > that i want to use value from ("sharevar"/manifest/genreic.pp) > > the $vartest value > > > > hope this helps > > > > thank you for your effort . > > class sharevar { > $vartest = "info" > } > > class newmodule { > # you have to include sharevar somewhere, can be in a node or anywhere > else > include sharevar > > # access the variable in another module in a .pp file > notify{"vartest is ${sharevar::vartest}": } > > # access it in a template > file{"/tmp/test": content => template("new.erb")} > } > > > new.erb: > > <%= scope.lookupvar("sharevar::vartest") %> > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
i am getting Error 400 on SERVER: Could not find class sharevar::generic in namespaces newmodule::men On Wed, Jul 18, 2012 at 12:16 PM, Yaniv Fine <yanivfine@gmail.com> wrote:> i''ll try that . > > > On Wed, Jul 18, 2012 at 12:12 PM, R.I.Pienaar <rip@devco.net> wrote: > >> >> >> ----- Original Message ----- >> > From: "Yaniv Fine" <yanivfine@gmail.com> >> > To: puppet-users@googlegroups.com >> > Sent: Wednesday, July 18, 2012 10:03:01 AM >> > Subject: Re: [Puppet Users] Re: Out-of-Scope Variables >> > >> > >> > Frank . >> > let me put it all together :) >> > >> > i have a module name "sharevar" >> > i have another module "newmodule" >> > inside "sharevar"/manifest/genreic.pp >> > class sharevar::generec { >> > $vartest = ''infooramtion'' >> > } >> > >> > i have newmodule/manifest/men.pp >> > that include the content => template path erb file >> > and i have the newmodule/templates/new.erb file >> > that i want to use value from ("sharevar"/manifest/genreic.pp) >> > the $vartest value >> > >> > hope this helps >> > >> > thank you for your effort . >> >> class sharevar { >> $vartest = "info" >> } >> >> class newmodule { >> # you have to include sharevar somewhere, can be in a node or anywhere >> else >> include sharevar >> >> # access the variable in another module in a .pp file >> notify{"vartest is ${sharevar::vartest}": } >> >> # access it in a template >> file{"/tmp/test": content => template("new.erb")} >> } >> >> >> new.erb: >> >> <%= scope.lookupvar("sharevar::vartest") %> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 07/18/2012 11:26 AM, Yaniv Fine wrote:> i am getting > > Error 400 on SERVER: Could not find class sharevar::generic in > namespaces newmodule::menHardly surprising.> inside "sharevar"/manifest/genreic.pp >> class sharevar::generec {Both file and class name are horribly typoed. Please fix. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
... still getting it even after fixing . Could not find class sharedvar::generic in namespaces newmodule::men i am doing copy paste . damm On Wed, Jul 18, 2012 at 12:52 PM, Felix Frank < felix.frank@alumni.tu-berlin.de> wrote:> On 07/18/2012 11:26 AM, Yaniv Fine wrote: > > i am getting > > > > Error 400 on SERVER: Could not find class sharevar::generic in > > namespaces newmodule::men > > Hardly surprising. > > > inside "sharevar"/manifest/genreic.pp > >> class sharevar::generec { > > Both file and class name are horribly typoed. Please fix. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 07/18/2012 12:22 PM, Yaniv Fine wrote:> ... > still getting it even after fixing . > > Could not find class sharedvar::generic in namespaces newmodule::men > > i am doing copy paste . > dammIs the module name "sharevar" or "sharedvar"? The easiest way about this was for you to supply the full paths to all manifest files and the manifest contents. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
this time i got it !!!!. i have made a newbie error by creating the mentifest/pp file inside a directory name share_var instead of sharevar !! thank you very much for you kind help ... On Wed, Jul 18, 2012 at 2:03 PM, Felix Frank < felix.frank@alumni.tu-berlin.de> wrote:> On 07/18/2012 12:22 PM, Yaniv Fine wrote: > > ... > > still getting it even after fixing . > > > > Could not find class sharedvar::generic in namespaces newmodule::men > > > > i am doing copy paste . > > damm > > Is the module name "sharevar" or "sharedvar"? > > The easiest way about this was for you to supply the full paths to all > manifest files and the manifest contents. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.