summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index ac6f5e8923..f0a7751743 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -127,6 +127,7 @@ class Chef
@default_guard_interpreter = :default
@elapsed_time = 0
@sensitive = false
+ @cloning_behavior = Chef::Config[:default_resource_cloning_behavior]
end
#
@@ -174,6 +175,21 @@ class Chef
end
end
+ #
+ # The kind of cloning behavior on the resource. Supported values are:
+ #
+ # :clone - old CHEF-3694 style resource cloning
+ # :rewind - overwrite the resource properties of the prior resource directly
+ # :none - no cloning at all
+ #
+ def cloning_behavior(arg=nil)
+ set_or_return(
+ :cloning_behavior,
+ arg,
+ kind_of: Symbol,
+ )
+ end
+
# Alias for normal assigment syntax.
alias_method :action=, :action