이런 요리책이 있어요.
if node['httpd'] == "nginx"
package "nginx" do
action :install
end
# a lot more stuff
end
그러나 나는 성명서에 모든 설정을 포함하고 싶지 않습니다 if
. 쉐프에 이렇게 쓰는 방법이 있나요?
next if node['httpd'] != "nginx"
package "nginx" do
action :install
end
# a lot more stuff
node['httpd']
그렇지 않은 경우 "nginx"
다음 요리책으로 이동하고 싶습니다.
답변1
return
다음과 같이 레시피의 나머지 부분에 대한 평가를 건너뛰는 데 사용할 수 있습니다 .
return if node['httpd'] != 'nginx'
# ...