<commit_before>#
# Cookbook:: chef-client
# resource:: chef_client_scheduled_task
#
# Copyright:: 2017, Chef Software, Inc.
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

resource_name :chef_client_scheduled_task

property :user, String, default: 'System'
property :password, String
property :frequency, String, default: 'minute'
property :frequency_modifier, [Integer, String], default: 30
property :start_time, String
property :splay, [Integer, String], default: 300
property :config_directory, String, default: 'C:/chef'
property :log_directory, String, default: lazy { |r| "#{r.config_directory}/log" }
property :chef_binary_path, String, default: 'C:/opscode/chef/bin/chef-client'
property :daemon_options, Array, default: []

action :add do
  create_chef_directories

  # Build command line to pass to cmd.exe
  client_cmd = new_resource.chef_binary_path.dup<commit_msg>Provide better error messages if the wrong frequency is passed to the windows task<commit_after>#
# Cookbook:: chef-client
# resource:: chef_client_scheduled_task
#
# Copyright:: 2017, Chef Software, Inc.
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

resource_name :chef_client_scheduled_task

property :user, String, default: 'System'
property :password, String
property :frequency, String, default: 'minute', equal_to: ['minute', 'hourly', 'daily', 'monthly', 'once', 'on_logon', 'onstart', 'on_idle']
property :frequency_modifier, [Integer, String], default: 30
property :start_time, String
property :splay, [Integer, String], default: 300
property :config_directory, String, default: 'C:/chef'
property :log_directory, String, default: lazy { |r| "#{r.config_directory}/log" }
property :chef_binary_path, String, default: 'C:/opscode/chef/bin/chef-client'
property :daemon_options, Array, default: []

action :add do
  create_chef_directories

  # Build command line to pass to cmd.exe
  client_cmd = new_resource.chef_binary_path.dup
{'fraction_non_alphanumeric': 0.10037684138403563, 'fraction_numerical': 0.008907159986296678, 'mean_word_length': 5.532438478747204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5257640', 'n_tokens_mistral': 866, 'n_tokens_neox': 835, 'n_words': 325}