diff options
Diffstat (limited to 'lib/chef/resource/windows_task.rb')
-rw-r--r-- | lib/chef/resource/windows_task.rb | 114 |
1 files changed, 80 insertions, 34 deletions
diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb index 3dea434a33..9af20f8af0 100644 --- a/lib/chef/resource/windows_task.rb +++ b/lib/chef/resource/windows_task.rb @@ -31,41 +31,87 @@ class Chef allowed_actions :create, :delete, :run, :end, :enable, :disable, :change default_action :create - property :task_name, String, regex: [/\A[^\/\:\*\?\<\>\|]+\z/], name_property: true - property :command, String - property :cwd, String - property :user, String, default: "SYSTEM" - property :password, String - property :run_level, equal_to: [:highest, :limited], default: :limited - property :force, [TrueClass, FalseClass], default: false - property :interactive_enabled, [TrueClass, FalseClass], default: false - property :frequency_modifier, [Integer, String], default: 1 - property :frequency, equal_to: [:minute, - :hourly, - :daily, - :weekly, - :monthly, - :once, - :on_logon, - :onstart, - :on_idle, - :none] - property :start_day, String - property :start_time, String - property :day, [String, Integer] - property :months, String - property :idle_time, Integer - property :random_delay, [String, Integer] - property :execution_time_limit, [String, Integer], default: "PT72H" # 72 hours in ISO8601 duration format - property :minutes_duration, [String, Integer] - property :minutes_interval, [String, Integer] - property :priority, Integer, description: "Use to set Priority Levels range from 0 to 10.", default: 7, - callbacks: { "should be in range of 0 to 10" => proc { |v| v >= 0 && v <= 10 } } - property :disallow_start_if_on_batteries, [TrueClass, FalseClass], default: false, - introduced: "14.4", + property :task_name, String, regex: [/\A[^\/\:\*\?\<\>\|]+\z/], + description: "The task name, such as 'Task Name' or '/Task Name'", + name_property: true + + property :command, String, + description: "" + + property :cwd, String, + description: "The directory the task will be run from." + + property :user, String, + description: "The user to run the task as.", + default: "SYSTEM" + + property :password, String, + description: "The user’s password. The user property must be set if using this property." + + property :run_level, Symbol, equal_to: [:highest, :limited], + description: "Run with ':limited' or ':highest' privileges.", + default: :limited + + property :force, [TrueClass, FalseClass], + description: "When used with create, will update the task.", + default: false + + property :interactive_enabled, [TrueClass, FalseClass], + description: "", default: false + + property :frequency_modifier, [Integer, String], + default: 1 + + property :frequency, Symbol, equal_to: [:minute, + :hourly, + :daily, + :weekly, + :monthly, + :once, + :on_logon, + :onstart, + :on_idle, + :none], + description: "The frequency with which to run the task." + + property :start_day, String, + description: "Specifies the first date on which the task runs in MM/DD/YYYY format." + + property :start_time, String, + description: "Specifies the start time to run the task, in HH:mm format." + + property :day, [String, Integer], + description: "The day(s) on which the task runs." + + property :months, String, + description: "The Months of the year on which the task runs, such as: 'JAN, FEB' or '\*'. Multiple months should be comma delimited. e.g. 'Jan, Feb, Mar, Dec'." + + property :idle_time, Integer, + description: "For :on_idle frequency, the time (in minutes) without user activity that must pass to trigger the task, from 1 - 999." + + property :random_delay, [String, Integer], + description: "" + + property :execution_time_limit, [String, Integer], + description: "The maximum time (in seconds) the task will run.", + default: "PT72H" # 72 hours in ISO8601 duration format + + property :minutes_duration, [String, Integer], + description: "" + + property :minutes_interval, [String, Integer], + description: "" + + property :priority, Integer, + description: "Use to set Priority Levels range from 0 to 10.", + default: 7, callbacks: { "should be in range of 0 to 10" => proc { |v| v >= 0 && v <= 10 } } + + property :disallow_start_if_on_batteries, [TrueClass, FalseClass], + introduced: "14.4", default: false, description: "Disallow start of the task if the system is running on battery power." - property :stop_if_going_on_batteries, [TrueClass, FalseClass], default: false, - introduced: "14.4", + + property :stop_if_going_on_batteries, [TrueClass, FalseClass], + introduced: "14.4", default: false, description: "Scheduled task option when system is switching on battery." attr_accessor :exists, :task, :command_arguments |