It works as expected after providing name to the package.
*class ctf ($version) { $ctfdest = sprintf('C:\PuppetSWT\CTF-%s.exe',
$version) package { 'CTF': name => 'CTF-'${version},
ensure => 'installed', source => $ctfdest,
install_options => [ '/S' ], }}*
On Tuesday, May 31, 2016 at 7:31:08 PM UTC+5:30, Harish Kothuri wrote:
>
> Hi All,
>
> I have a puppet class which accepts parameter "$version" for a software
> package.
>
> The problem is when i do puppet agent -t , it is installing the software
> package though the same version is present already. All works fine if i
> remove the parameter to a class and hard code the version.
>
> Below is my code for with and without parameter to a class
>
> *With Parameter:(DOES NOT SKIP installation- PROBLEMATIC)*
>
>
>
>
> *class ctf ($version) { $ctfdest = sprintf('C:\PuppetSWT\CTF-%s.exe',
> $version) package { 'CTF': ensure => 'installed',
> source => $ctfdest, install_options => [ '/S' ], }}*
>
>
> *Without Parameter: (SKIPS installation when i run second time- EXPECTED)*
>
>
>
>
>
> *class ctf_v_1_3_8 { $ctfdest = 'C:\PuppetSWT\CTF-1.3.8.exe' package {
> 'CTF-1.3.8': ensure => 'installed', source =>
> $ctfdest, install_options => [ '/S' ], }}This is going to be major
> problem as i dont want to end up in creating multiple classes for different
> versions , can someone help to understand why this different behavior and
> solution.?Thanks a lot.*
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/2a55dc06-398b-4f10-8c84-c27984f3b9c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.