Don't confuse them. import tells puppet to read a file it wouldn't normally.
Any .pp file in a module directory will be read, so import means nothing.
You might need to set require => Class['my module::settings'] to ensure that
this module is evaluated first so that the variables are available.
On Dec 2, 2011, at 11:57 AM, Sans wrote:
> It's actually like: "modulepath/modules/mymodule/manifests/
> settings.pp" and I was trying to use those variables in the other
> manifests in "mymodule". I know that autoloader and "include" classes
> are the way of doing these day but as nothing worked so far, so I
> tried "import" method as well. I didn't try "$settings::my_var1" thing
> yet but I'm giving it a shot now.
>
> Cheers,
> Santanu
>
>
>>
>> Assuming you did something like:
>>
>> # modulepath/modules/settings/manifests/init.pp
>> class settings {
>> $my_var1 = "myvar1"
>>
>> }
>>
>> and include the class "settings", from other classes you can refer to it as:
>>
>> $settings::my_var1
>>
>> Does that help?
>>
>> I noticed you used the word "import". The most frictionless way to use
>> Puppet these days is to avoid import, and to instead structure your classes
>> in modules, and use the autoloader and "include" classes rather than
>> importing manifest files.
>>
>> --
>> Nigel Kersten
>> Product Manager, Puppet Labs
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other
randomness
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.