Hi Harish,
On 09 Jun 2016, at 06:49, Harish Kothuri <harishkoth...@gmail.com> wrote:

> Hi,
> 
> I have classA with parameter and i want to include this in another classB . I 
> expected to consider the default value defined in foreman for classA but it's 
> not happening. 
> 
> 
> class classA ($version)
> {
>    
>   Package { 'Package A' 
>       ensure           => 'installed',
>       source           => 'C:\install\file_${version}.msi',
>   }
> }

You defined a class with a parameter without a default value.
When declaring (include) this class you must pass a value to the parameter by 
using class as resource type:
e.g.
class { ‘classA’:
  version => ‘1.2.3’,
}

> 
> 
> class classB($variable)
> {
> 
> include classA   # throws error in this line "Must pass parameter to Class 
> [ClassA]
> 
>   Package { 'title B' 
>       ensure           => 'installed',
>       source           => 'C:\install\file_${variable}.msi',
>       require           => Package['Package A'],
>   }
> }
> 
> 
> Can someone help me on this.
> 
> Thanks
> 
> -- 
> 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/fc54c6ea-276e-41d9-b6c3-93390846f1df%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/342A8E0D-4070-4B1B-8796-FF2E2424A141%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to