- From: Carlos Camacho <
>
- To: "
" <
>
- Subject: [chef] NOT_IF and ONLY_IF validation problem.
- Date: Wed, 20 Aug 2014 14:16:29 +0200
Hello!
Im runing this simple recipe block to create a web app in IIS
powershell_script "create_site_my_site" do
code "New-webapppool -name 'My_Web_App'; New-Website -Name
'My_Web_App' -applicationpool 'My_Web_App' -Port '80' -IPAddress *
-PhysicalPath 'c:\webs\My_Web_App' "
action :run
not_if "get-website | where-object { $_.name -eq 'My_Web_App' }"
end
The problem here its that the NOT_IF part its allways True
PS C:\Users\carlos>
PS C:\Users\carlos> get-website | where-object { $_.name -eq 'asdfasdfasdf' }
PS C:\Users\carlos> echo $lastexitcode
1
PS C:\Users\carlos> get-website | where-object { $_.name -eq 'My_Web_App' }
Name ID State Physical Path
Bindings
---- -- ----- -------------
--------
My_Web_App 6 Stopped c:\webs\My_Web_App http *:80:
https *:443:
PS C:\Users\carlos.camacho> echo $lastexitcode
1
Now, my question is about how to return True or False in the NOT_IF
depending on my code return value ??
Thanks.
- [chef] NOT_IF and ONLY_IF validation problem., Carlos Camacho, 08/20/2014
Archive powered by MHonArc 2.6.16.