beaker-task_helper 1.4.3 → 1.4.4

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: 363d11e08c334b4a19ca9e61fa15873d456fafab
4
- data.tar.gz: 76664fe2a2149731e544f35fc47ad076932f4672
3
+ metadata.gz: 4d878200c6c5b7c0bd57240d2914aeaaad926d72
4
+ data.tar.gz: ffce9e83378d3b2486f79eac959ee4edcb08512e
5
5
  SHA512:
6
- metadata.gz: 9d4fccb0565a4bb370062346ae09750ae57cd2e298ec6cb5024c9cda79f29e895d910ac82bcd7f8505d712855d52d5b920792f0a5d1b95448138f76372d68042
7
- data.tar.gz: 3a89b9bf3808d23fe4f121046883d8cb3632ece68c52c92b30b8085c4f40667026f9dfa1194c4f604c9c7e6a148ce9c7fac240df5b8234029194fdde600e2be7
6
+ metadata.gz: 3f660564b6d17c6d86f48e338a37b152b7ead8525b79ef0998396908e7293bd803cc352fd87732561236f171b7aa65f6351ac5b06d39b8b038aecf929f2027ec
7
+ data.tar.gz: e43110847a9dd8b6a18b5b95f282cbc5f8bab0af523ef39f572e31cf91ed064db94f87534dd2d61b9cabffda388d334ca52f06f0928730225a06aed05c15330e
@@ -49,6 +49,21 @@ INSTALL_BOLT_PP
49
49
  on(master, puppet('access', 'login', '--username', user, '--lifetime', lifetime), stdin: password)
50
50
  end
51
51
 
52
+ #Setup ssh access between task runner and nodes
53
+ #@param [Host] Task runner
54
+ #@param [Array<Host> Nodes on which to run the task
55
+ #
56
+ #TODO: Implement on windows
57
+ def setup_ssh_access(task_runner, nodes)
58
+ ssh_dir_path = '/root/.ssh/'
59
+ rsa_pub_path = "#{ssh_dir_path}/id_rsa.pub"
60
+
61
+ on task_runner, "ssh-keygen -f #{ssh_dir_path}/id_rsa -t rsa -N ''"
62
+ public_key = on(task_runner, "cat #{rsa_pub_path}").stdout
63
+ create_remote_file(nodes, "#{rsa_pub_path}", public_key)
64
+ on(nodes, "cat #{rsa_pub_path} >> #{ssh_dir_path}/authorized_keys")
65
+ end
66
+
52
67
  def run_task(task_name:, params: nil, password: DEFAULT_PASSWORD, host: nil, format: 'human')
53
68
  output = if pe_install?
54
69
  host = master.hostname if host.nil?
@@ -68,10 +83,12 @@ INSTALL_BOLT_PP
68
83
  end
69
84
 
70
85
  def run_bolt_task(task_name:, params: nil, password: DEFAULT_PASSWORD,
71
- host: 'localhost', format: 'human')
86
+ host: 'localhost', format: 'human', module_path: '/etc/puppetlabs/code/modules')
72
87
  if fact_on(default, 'osfamily') == 'windows'
73
88
  bolt_path = '/cygdrive/c/Program\ Files/Puppet\ Labs/Puppet/sys/ruby/bin/bolt.bat'
74
- module_path = 'C:/ProgramData/PuppetLabs/code/modules'
89
+ unless module_path
90
+ module_path = 'C:/ProgramData/PuppetLabs/code/modules'
91
+ end
75
92
 
76
93
  if version_is_less('0.15.0', BOLT_VERSION)
77
94
  check = '--no-ssl'
@@ -80,7 +97,6 @@ INSTALL_BOLT_PP
80
97
  end
81
98
  else
82
99
  bolt_path = '/opt/puppetlabs/puppet/bin/bolt'
83
- module_path = '/etc/puppetlabs/code/modules'
84
100
 
85
101
  if version_is_less('0.15.0', BOLT_VERSION)
86
102
  check = '--no-host-key-check'
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module TaskHelper
3
- VERSION = '1.4.3'.freeze
3
+ VERSION = '1.4.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-task_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - puppet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2018-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop