We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fa0198e + 6f22a7a commit 35b332cCopy full SHA for 35b332c
tasks/init.rb
@@ -39,7 +39,12 @@ def async_command(cmd, wait_time = nil)
39
when 'windows'
40
# This appears to be the only way to get the processes to properly detach
41
# themselves, it was a HUGE PAIN to fugure out
42
- require 'win32/process'
+ # win32/process is needed on Puppet < 7
43
+ # Puppet 7 monkey patches Ruby's Process Module
44
+ # and Process.create will be available
45
+ require 'puppet'
46
+ require 'win32/process' if Puppet::Util::Package.versioncmp(Puppet.version, '7.0.0') < 0
47
+
48
Process.create(
49
command_line: "cmd /c start #{cmd}",
50
creation_flags: Process::DETACHED_PROCESS,
0 commit comments