Skip to content

Commit

Permalink
chef_client_scheduled_task: Only create the log dir if it doesn't exist
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Aug 26, 2020
1 parent 92cad06 commit 18fca9d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions resources/scheduled_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@
property :daemon_options, Array, default: []

action :add do
# create a directory in case the log director does not exist
directory new_resource.log_directory do
inherits true
recursive true
action :create
# create a directory in case the log directory does not exist
unless Dir.exist?(new_resource.log_directory)
directory new_resource.log_directory do
inherits true
recursive true
action :create
end
end

# According to https://docs.microsoft.com/en-us/windows/desktop/taskschd/schtasks,
Expand Down

0 comments on commit 18fca9d

Please sign in to comment.