You can access other modules variables by using the namespace of the variable as long as the class with the referring variable is known to the catalog compilation (has been included or declared).
e.g. # modules/abc/manifests/init.pp class abc { $var = ‘foo’ } # site/profile/manifests/abc.pp class profile::abc { include abc $var = $abc::var notify { $var: } } puppet apply -e ‘include profile::abc’ will return notify ‘foo’ > On 23 Jan 2017, at 23:21, java.frea...@gmail.com wrote: > > Hi Everyone, > > Am very new to puppet. Can any one please help me to fix this issue > !! > I need to access $var1 at inside module folder actually which > declared at profile. > > > ######################################################################### > /etc/puppetlabs/puppet/environment/dev/site/profile/manifest/abc.pp > > class profile::abc($var1 = '5' ) > { > ------- // some code here // -------- > > } > ########################################################################### > /etc/puppetlabs/puppet/environment/dev/module/abc/manifest/abc.pp > I need to access $var1 in this file :- /module/abc/manifest/abc.pp > class abc($var1 = undef) > { > --------// I want to access $var1 in this class. How I can access ???? // > --------------------- > } > > -- > 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/ac7cfed8-3526-4df5-97c0-107fb05b4231%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/C69CE134-46E8-4FB0-983B-F90C6336F317%40gmail.com. For more options, visit https://groups.google.com/d/optout.