On Sun, Nov 3, 2013 at 10:46 AM, Ken Netherland <
[email protected]> wrote:

> Can someone please explain the logic here?
>
> The Puppet documentation says the following:
>
> If this parameter is set, then this exec will run unless the command
> returns 0
>
> So in the following if Windows Feature is installed, PS returns 1, meaning
> it will execute, correct?
>
> exec
> {
> 'Install-Application-Server':
> command   => 'import-module servermanager; Add-WindowsFeature
> Application-Server -Restart',
> unless  => 'if ((get-windowsfeature -name Application-Server).Installed)
> { exit 1 }',
> provider  => powershell,
> }
>

Note what Dustin said. Also that if this feature is installed that PS will
exit with a 1, which if ruby interprets that correctly will cause the
command to get executed.

You probably are posting something after testing it a bit, but note that
your logic says install this feature if it is already installed and do not
install it if it is not installed.


>
> Is this a Windows related anomaly or am I missing something?
>

Notice how I mentioned if ruby interprets the exit code correctly above. We
have an open issue to work around this (I can't seem to locate it at the
moment).

Note that this is a ruby bug - https://bugs.ruby-lang.org/issues/8083


>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" 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-dev/1ef6179e-aa68-4ad5-b8ce-04d80dd29321%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Rob Reynolds
Developer, Puppet Labs

Join us at PuppetConf 2014, September 23-24 in San Francisco

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev/CAMJiBK6wgLYfwGCfaNVK25ODtjpLpy9k6HtsZHGzoAxPn5XEnw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to