[chef] Re: RE: Re: RE: RE: Re: RE: RE: RE: Re: RE: Re: Idempotent IIS


Chronological Thread 
  • From: Kenneth Barry < >
  • To:
  • Subject: [chef] Re: RE: Re: RE: RE: Re: RE: RE: RE: Re: RE: Re: Idempotent IIS
  • Date: Tue, 25 Feb 2014 10:25:52 -0800

What am I doing wrong?

I expect the sode block to "not [run] if" the value of the setting is current '4'.

When I run this code

powershell_script "testDynamicCompressionLevel" do
    code <<-EOB
        Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.webServer/httpCompression/ 'gzip']" -name "dynamicCompressionLevel" -value 4
    EOB
    not_if 'powershell -noninteractive -noprofile -command "exit [int32]((get-WebConfigurationProperty -pspath "MACHINE/WEBROOT/APPHOST"  -filter "system.webServer/httpCompression/ "gzip"]" -name "dynamicCompressionLevel").value -eq 4)"'
end

on  machine 1 the powershell command in the not_if evaluated to false (because its set to 0) I run this command from the prompt on the machine locally.

upon chef-client i get the following lines:

[2014-02-25T13:23:16-05:00] INFO: powershell_script[testDynamicCompressionLevel] ran successfully

    - execute "powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy RemoteSigned -InputFormat None -File
"C:/Users/kbarry-x/AppData/Local/Temp/chef-script20140225-2672-jjmxxc.ps1"


and not the setting is '4', so the test evaluates as true

but when I chef-client again i get the same results, instead of a "skipped due to not_if"





Archive powered by MHonArc 2.6.16.

§