Ask Your Question
0

puppet agent not doing unless properly on Windows?

asked 2015-05-26 11:17:53 -0500

jmp242 gravatar image

Ok, I've spent days chasing this around. Is there an issue with puppet agent 3.7.1 x64 on Windows 7 x64 where execs with "unless" don't ever NOT run the command? I've tried doing Batch, Powershell and now a compiled AutoIT executable:

exec { 'disablepublicchocolatey':
        command => "C:/ProgramData/chocolatey/choco.exe source disable -n=chocolatey",
        unless  => 'c:/ProgramData/puppetfiles/checkifexists.exe repo "chocolatey [disabled]"',
        require => [Exec['chocolatelyinstall'],File['checkifexists.exe']],
      }

My script returns 1 if it finds the text 'chocolatey [disabled]' in the output of choco source list (the text match is NOT case sensitive)... So... this should NOT run if

c:\TEMP\AutoitScripts\chocolatey>choco source list     
Chocolatey v0.9.9.6   
chocolatey [Disabled] - https://chocolatey.org/api/v2/

but it seem to always run... Is there a bug? Am I just very confused?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-05-26 15:50:53 -0500

I think this is the same or similar to the question over at http://stackoverflow.com/q/30400186/1...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-05-26 11:17:53 -0500

Seen: 264 times

Last updated: May 26 '15