Ask Your Question

puppet agent not doing unless properly on Windows?

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

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

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

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

I think this is the same or similar to the question over at

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


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

Seen: 309 times

Last updated: May 26 '15