kitchen-transport-train 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 133f962428df05c64cdd391b97494d38e8e63bef96ef3ee4df43927f66809516
4
- data.tar.gz: 9071b6c0b96470fc32638422f3c2658e7a5dfe63c387269fd176fbf5717d3f7f
3
+ metadata.gz: 73b1cac962017682b0b06008f9f5d6ed0abdfda2be33a39c4cb487ad703773c2
4
+ data.tar.gz: faa11ed4ab87a67bc9dc6b2caffb74b2538d5166c3a742549a5524b037367b12
5
5
  SHA512:
6
- metadata.gz: 361d12c68100e3ffc4ca93cba6d8ae1ea9cc4a56aa77c09ae85bd8708dbe7bc8a05dabc0edf3785aa553ea22379c27c38c8c37397adba60c22446882e0e558d1
7
- data.tar.gz: 84f44ff085c7784525da0b3b2a46d54d5672aca6607190698141874c3c21b1e664ef7ab7f9e5152122687968041b96b6aeaf0329d31e78bfec47d7c9e6e03dc4
6
+ metadata.gz: 554fc9afd48408fd7615b616a54b4603f2bf6a2efb69f9e96157f54182686b32031005f5899cc865c388c030dc76ff8d93bb018ec5ca96f768df13cd484c5c50
7
+ data.tar.gz: 45f6bf81dffdf21825fa92b5f46225bd0cff7a558f033470382e0f20c05b12cb56e5205161db44e5f4d3bccb1a911b23c293a87c4dd252aec3ac316cc0fd751c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 0.2.0
4
+
5
+ - Fix disparity between TestKitchen SSH wait parameters and Train
6
+ - Fix user passing via a `train_user` override parameters
7
+ - Add call to generate an RFC099 credentials file
8
+
3
9
  ## Version 0.1.0
4
10
 
5
11
  - Initial version
data/README.md CHANGED
@@ -45,6 +45,10 @@ transport:
45
45
 
46
46
  Options `user`, `host` and `password` (for kitchen-ec2 and Windows instances) are set automatically.
47
47
 
48
+ If you want to use `kitchen-ec2` with the `root` user however (as needed in Chef 19 Target Mode), you need to additionally specify `train_user: root`. This is due to a long-standing bug in Kitchen-EC2 where the standard platform's autodetected user will override manually specified `root` values.
49
+
50
+ Standard and community-supported options for transports:
51
+
48
52
  - [AWS Session Manager Transport](https://github.com/tecracer-chef/train-awsssm/blob/master/lib/train-awsssm/transport.rb#L8-L14)
49
53
  - Docker Transport: no additional options
50
54
  - [Serial/USB Transport](https://github.com/tecracer-chef/train-serial/blob/master/lib/train-serial/transport.rb#L8-L22)
@@ -39,6 +39,31 @@ module Kitchen
39
39
  yield self if block_given?
40
40
  end
41
41
 
42
+ def train_uri
43
+ @connection.uri
44
+ end
45
+
46
+ def credentials_file
47
+ instance_name = @connection.transport_options[:instance_name]
48
+
49
+ config = @backend.instance_variable_get(:@connection_options)
50
+ config.compact!
51
+ config.transform_values! { |v| v.is_a?(Symbol) ? v.to_s : v }
52
+
53
+ # Some configuration variables vary between transports
54
+ config[:host] = config[:hostname] = @connection.transport_options[:host]
55
+ config[:key_files] = @connection.transport_options[:key_files]
56
+
57
+ # Due to a long-standing bug in TestKitchen, standard platforms will override
58
+ # kitchen.yml `user` settings, so this transport introduces an "train_user" override.
59
+ # See https://github.com/test-kitchen/kitchen-ec2/pull/273
60
+ config[:user] = config[:username] = @connection.transport_options[:train_user] || @connection.transport_options[:user]
61
+
62
+ require "toml-rb" unless defined?(TomlRB)
63
+
64
+ "['#{instance_name}']\n" + TomlRB.dump(config)
65
+ end
66
+
42
67
  def execute(command)
43
68
  return if command.nil?
44
69
 
@@ -95,6 +120,10 @@ module Kitchen
95
120
  data.delete(:ssh_key)
96
121
  end
97
122
 
123
+ # Adjust option defaults
124
+ data[:retries] = 15
125
+ data[:delay] = 5
126
+
98
127
  data
99
128
  end
100
129
  end
@@ -1,3 +1,3 @@
1
1
  module KitchenTransportTrain
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-transport-train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Heinen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2024-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.0.3
57
+ rubygems_version: 3.3.27
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: Kitchen transport for any Train backend