chef-zero-scheduled-task 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b5fa275005e105d18cb6b5ec89e06cea8a93182
4
- data.tar.gz: 345aeadb9151ac547d05c26f76fbceecc54db322
3
+ metadata.gz: bf269b33ca5ac6f65be285cb971360b8e38baf3e
4
+ data.tar.gz: bbbb3f130e58edeac35ac4c86501b4bda5cce9a9
5
5
  SHA512:
6
- metadata.gz: 3d033f71ec251ec5ea44952213b93a5073b32e6b6ac0461e8d3fd8b6f4f408803fbb7fc68c820b0c24890c7340777c8474b90b3cc8e424d8125a8b9c15a55a99
7
- data.tar.gz: 63be65cde40949e44a9af397457f5886417b5c29c5b9371648fbe238f771e95542dec0b0964205034b30f6c0f22c8fc60bcfef89b0646a5ee393207f10911fc0
6
+ metadata.gz: c5b70056f8fd890306c727dd430cf6fed9096127a9a474789750db2a59ad87cbe4216a79c3059207539ec9a7a2ab3b3f4c2e89775b6394bc8e83f81e2832502a
7
+ data.tar.gz: bd0de042167c6755af2d692f6d5e66d1f67f644f164868bcf9caf6cb90cccec948d2b2d33f9d0e51ec4c995356f428721df672a73fd80e8eb343e4b45f59eeb9
@@ -2,7 +2,7 @@ module Chef
2
2
  module Zero
3
3
  module Scheduled
4
4
  module Task
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  end
7
7
  end
8
8
  end
@@ -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 #{@instance.transport[:username]} /rp #{@instance.transport[:password]} /sc daily /st 00:00 /f /tr "$cmd_line"
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.1
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-16 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler