summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@chef.io>2020-02-11 09:02:57 -0800
committerGitHub <noreply@github.com>2020-02-11 09:02:57 -0800
commit1aee11561749f280f7e3c686bac4c07053246210 (patch)
tree13e50b7cb06d764d3e16d8a3b648a9bae925470f /lib/chef/resource.rb
parentfc8b3f0b89f6d4cd705f5f757d4d173d1aac6be8 (diff)
downloadchef-1aee11561749f280f7e3c686bac4c07053246210.tar.gz
Add compile_time property to all resources (#9360)
This eliminates one thing that people need to memorize The ohai_hint and hostname resources still default to true This also forces the resource to `action :nothing` in the converge phase automatically, which is a behavior which has been missed up until now. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 15d9fec12d..ca1736aef9 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -415,7 +415,6 @@ class Chef
@not_if
end
- #
# The number of times to retry this resource if it fails by throwing an
# exception while running an action. Default: 0
#
@@ -427,7 +426,6 @@ class Chef
#
property :retries, Integer, default: 0, desired_state: false
- #
# The number of seconds to wait between retries. Default: 2.
#
# @param arg [Integer] The number of seconds to wait between retries.
@@ -435,7 +433,6 @@ class Chef
#
property :retry_delay, Integer, default: 2, desired_state: false
- #
# Whether to treat this resource's data as sensitive. If set, no resource
# data will be displayed in log output.
#
@@ -444,7 +441,16 @@ class Chef
#
property :sensitive, [ TrueClass, FalseClass ], default: false, desired_state: false
+ # If this is set the resource will be set to run at compile time and the converge time
+ # action will be set to :nothing.
#
+ # @param arg [Boolean] Whether or not to force this resource to run at compile time.
+ # @return [Boolean] Whether or not to force this resource to run at compile time.
+ #
+ property :compile_time, [TrueClass, FalseClass],
+ description: "Determines whether or not the resource is executed during the compile time phase.",
+ default: false, desired_state: false
+
# The time it took (in seconds) to run the most recently-run action. Not
# cumulative across actions. This is set to 0 as soon as a new action starts
# running, and set to the elapsed time at the end of the action.
@@ -458,7 +464,6 @@ class Chef
#
attr_accessor :executed_by_runner
- #
# The guard interpreter that will be used to process `only_if` and `not_if`
# statements. If left unset, the #default_guard_interpreter will be used.
#