John, Sorry for the typos in the code.for some reason I had to type the code instead of copying.I thought it would give a general idea about the format in which I wanted to write it.
Secondly, I used define inside a class because I could not see a way to call the define inside another class which is out of it. Let's say if I define something like *modules/profile/manifests/**user.pp* *:* define user (username=$name){ } I want to call it into parms.pp where I assign all my variables related to this module something like below.$name should expand into actual user name which is passed through init.pp class profile::params { $bashrc_host = "modules/profile/$fqdn_$name_bashrc" $bashrc = '/home/$name/.bashrc' } I am using puppet 2.7.hence I cannot use iterations to make it happen. On 5 Jan 2016 20:02, "jcbollinger" <john.bollin...@stjude.org> wrote: > > > On Monday, January 4, 2016 at 10:12:48 AM UTC-6, linux script wrote: >> >> Hi, >> >> The below code works fine for me. >> > > > I don't see how that could be, as your code contains syntax errors, and it > appears to reference a non-existent defined type named > "profile::config::params". > > > >> However, I want to reframe the code by using define statement in >> params.pp instead of config.pp. >> > > > Defined type definitions should appear at top scope in their own > manifests. Although it is syntactically allowed, it is poor form to nest > defined type definitions inside class definitions. Thus, a defined type in > module "profile" with simple name "user" should take this general form: > > *modules/profile/manifests/user.pp:* > > define profile::user($param1, $param2) { > # ... > } > > > >> I wanted to define it in params.pp so that I can use only variables in >> config.pp(ex:I am using $home/$name/.bashrc as file path in config which >> should be something like $bashrc if I would be able to use define in >> params.pp) >> > > > You are not making sense. Lexical nesting has no relationship to the > accessibility of class variables. > > It's unclear to me whether any of that actually speaks to your issue, > however. If not, then you'll have to explain more clearly what you are > trying to do, because I'm not catching it. I mean, I understand in a > general sense what your configuration objective is, but I'm not sure I > understand what your actual question is. > > > John > > -- > 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/2043e299-78c2-4db9-a704-b96f60457b39%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/2043e299-78c2-4db9-a704-b96f60457b39%40googlegroups.com?utm_medium=email&utm_source=footer> > . > 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/CAPLcSAAOHrgodGK7QaDdhUH2OjVSqLmxypghy-_D4zNFLDMgDw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.