Skip to content

Instantly share code, notes, and snippets.

@dodizzle
Created December 16, 2011 00:41
Show Gist options
  • Select an option

  • Save dodizzle/1483794 to your computer and use it in GitHub Desktop.

Select an option

Save dodizzle/1483794 to your computer and use it in GitHub Desktop.
nested has key for chef recipe
if node.has_key? "filesystem"
if node["filesystem"].has_key? "/dev/sda6"
if node["filesystem"]["/dev/sda6"].has_key? "mount"
if node['filesystem']['/dev/sda6']['mount'] == '/srv'
execute "foo" do
command "touch /tmp/nested_keys_exist!"
action :run
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment