chef-zero-scheduled-task 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf269b33ca5ac6f65be285cb971360b8e38baf3e
|
|
4
|
+
data.tar.gz: bbbb3f130e58edeac35ac4c86501b4bda5cce9a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5b70056f8fd890306c727dd430cf6fed9096127a9a474789750db2a59ad87cbe4216a79c3059207539ec9a7a2ab3b3f4c2e89775b6394bc8e83f81e2832502a
|
|
7
|
+
data.tar.gz: bd0de042167c6755af2d692f6d5e66d1f67f644f164868bcf9caf6cb90cccec948d2b2d33f9d0e51ec4c995356f428721df672a73fd80e8eb343e4b45f59eeb9
|
|
@@ -36,10 +36,11 @@ module Kitchen
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def init_command
|
|
39
|
+
resolve_username_and_password
|
|
39
40
|
wrap_shell_code( <<-EOH
|
|
40
41
|
$cmd_path = "#{remote_path_join(config[:root_path], "chef-client-script.ps1")}"
|
|
41
42
|
$cmd_line = $executioncontext.invokecommand.expandstring("powershell -executionpolicy unrestricted -File $cmd_path")
|
|
42
|
-
schtasks /create /tn "chef-tk" /ru #{@
|
|
43
|
+
schtasks /create /tn "chef-tk" /ru #{@task_username} /rp #{@task_password} /sc daily /st 00:00 /f /tr "$cmd_line"
|
|
43
44
|
EOH
|
|
44
45
|
)
|
|
45
46
|
end
|
|
@@ -78,6 +79,18 @@ module Kitchen
|
|
|
78
79
|
|
|
79
80
|
private
|
|
80
81
|
|
|
82
|
+
def resolve_username_and_password
|
|
83
|
+
local_state_file = @instance.diagnose[:state_file]
|
|
84
|
+
if local_state_file.key?(:password)
|
|
85
|
+
@task_username = local_state_file[:username]
|
|
86
|
+
@task_password = local_state_file[:password]
|
|
87
|
+
else
|
|
88
|
+
@task_username = @instance.transport[:username]
|
|
89
|
+
@task_password = @instance.transport[:password]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
end
|
|
93
|
+
|
|
81
94
|
def prepare_client_zero_script
|
|
82
95
|
cmd = [local_mode_command, *chef_client_args, '--logfile c:\chef\tk.log'].join(" ")
|
|
83
96
|
File.open(File.join(sandbox_path, 'chef-client-script.ps1'), 'w') do |file|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chef-zero-scheduled-task
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steven Murawski
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-06-
|
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|