This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# which goes first!? | |
template "/etc/init.d/reflex" do | |
source "reflex.init.erb" | |
owner "root" | |
group "root" | |
mode "644" | |
end | |
service "reflex" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set[:foo] = [{},{}] | |
foo.each do |foo| | |
foo[:name] = 3 | |
end | |
set[:foo] = [{},{}] | |
foo.each do |thing| | |
thing[:name] = 3 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chef::Platform.name_packages do | |
package("sudo").on(:gentoo).is("app-admin/sudo") | |
package("foo-dev") do | |
on(:redhat, :centos).is("foo-devel") | |
end | |
end | |
package "sudo" do | |
on(:gentoo) do | |
name "foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def includes?(other_array) | |
(self & other_array) == other_array | |
end | |
end | |
[1,2,3].includes?([2,3]) #=> true | |
[1,2,3].includes?([3,4]) #=> false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tempfile' | |
require 'chef/provider/script' | |
class Chef | |
class Provider | |
class ErlCall < Chef::Provider::Script | |
def action_run | |
case @new_resource.name_type | |
when "sname" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default[:packages][:dist_only] = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set_unless[:test][:frontend][:message] = "message from Xenu" | |
set_unless[:test][:frontend][:per_node] = "default value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test Mash.new unless attribute? :test | |
test[:frontend] = {} unless test.attribute? :frontend | |
test[:frontend][:message] = "message from Xenu" | |
test[:frontend][:per_node] = "default value" unless test[:frontend].attribute? :per_node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define :foobar do | |
execute "something" do | |
command "rm -rf #{params[:name]}" | |
only_if params[:only_if] | |
end | |
end | |
foobar "/" do | |
only_if { false } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Author:: Adam Jacob (<[email protected]>) | |
# Copyright:: Copyright (c) 2008 Opscode, Inc. | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder