Nan,

Thanks for the reply. That's certainly what the code and doc string
indicate. However, I think that I may have encountered a Puppet bug, but I
don't know enough Ruby to troubleshoot much.

Here's my new resource:

      package { "my_problematic_package.msi":
        ensure => present,
        provider => 'msi',
        install_options => ['/quiet', '/passive'],
        source => "C:/packages/my_problematic_package.msi",
        require => File["C:/packages/my_problematic_package.msi"],
      }

err: /Stage[main]/Sia/Package[my_problematic_package.msi]/ensure: change
from absent to present failed: Could not set 'present on ensure: undefined
method `include?' for nil:NilClass at
/etc/puppet/modules/sia/manifests/init.pp:71

The close brace for the package resource is at line 71.

I seems to be that the bug has to be at line 129 or 149 in
package.rb<https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/package.rb>,
but I ran added some debug statements, and neither "include?" statement is
run.

I'm not sure where to go from here. I suppose that using exec will be the
most expedient, but I'd also like some help on troubleshooting this
problem, so I can properly report it.

Thanks,
J

On Mon, Sep 24, 2012 at 9:10 PM, Nan Liu <[email protected]> wrote:

> On Mon, Sep 24, 2012 at 5:22 PM, jbrown <[email protected]> wrote:
> > Hello,
> >
> > I'm trying to install a few MSI packages on Windows, and I'm having
> trouble
> > specifying options.
> >
> > Here is what I want to execute
> >
> > C:\packages\my_problematic_package.msi \quiet \passive
> >
> > As you can see, I'm trying to specify two arguments to the package, but I
> > can't figure out how to use the Puppet package resource to accomplish
> this.
> > Install_options being a hash is causing me confusion.
> >
> > Here's my attempt at a resource definition:
> >
> >       package { "my_problematic_package.msi":
> >         ensure => installed,
> >         provider => 'msi',
> >         source => "C:/packages/my_problematic_package.msi",
> >         install_options => '/quiet /passive',
> >
> >         # Previous try as a hash
> >         # install_options => { " " => '/quiet /passive' },
> >
> >         require => File["C:/packages/my_problematic_package.msi"],
> >       }
> >
> > When I run this on the a Windows host, I get a help popup (same thing
> > without any install_options defined) that is the same as running '\?'.
> Then,
> > I get an error that says "the semaphore cannot be set again." Thinking
> that
> > Puppet may think the package is installed, I re-ran it with "ensure =>
> > absent," which succeeded, but subsequent install attempts failed with the
> > same error.
> >
> > The MSI is obviously executing because the help popup appears. It just
> seems
> > to be running with the incorrect options.
> >
> > Could anyone help?
>
> Looking at the code it's expecting an array (of string or hash). I'm
> not sure why the docs on the website shows just a hash, since the type
> is not doing munging.
>
>   install_options => ['\quiet', '\passive'],
>
> Might be a recent change, anyhow take a look at the inline
> documentation in the source code:
>
> https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/package.rb#L301
>
> Thanks,
>
> Nan
>
> --
> 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.
>
>

-- 
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.

Reply via email to