kitchen-scalr 0.2.2 → 0.2.3
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 +4 -4
- data/README.md +15 -5
- data/kitchen-scalr.gemspec +1 -1
- data/lib/kitchen/driver/scalr.rb +14 -9
- data/lib/kitchen/driver/scalr_ssh_script_template.rb +19 -4
- data/lib/kitchen/driver/scalr_version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb804557c97471c653a3a10e19146a07e0393fac
|
4
|
+
data.tar.gz: 1d46aad9bf348f7afc5887bc3fa284296e41e1fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dec56583fa44e36aadcdbef74edbebc4d2ac95f710e35fbead6b71020d56c59c9ef3b668706335df259e425baf35cf77d0794bd42929eb42c48add4935f17fd1
|
7
|
+
data.tar.gz: 36832a993dc9a197bcb2d153b0f5a01c09fc5d88d7dc1f8691c74ef5c8608117878c9115bcf509bd0933e535003c3e55a0022a74d9a6e6200b5d064e9b5f61a0
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# <a name="title"></a> Kitchen::Scalr
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/kitchen-scalr)
|
4
|
+
|
3
5
|
A Test Kitchen Driver for Scalr. This driver creates an instance on Scalr by creating a Farm containing a single Farm Role and granting Test Kitchen access to the corresponding server. It can work in two modes:
|
4
6
|
* **Image Mode:** (default) The user provides an image name and the driver will automatically create a role corresponding to this image as well as instanciate this role in a farm.
|
5
7
|
* **Role Mode:** the user provides a role id and the driver will instanciate it in a farm
|
@@ -14,7 +16,7 @@ Please read the [Driver usage][driver_usage] page for more details.
|
|
14
16
|
### scalr_env_id
|
15
17
|
**Required** This is a string corresponding to the environment id used by the plugin.
|
16
18
|
### scalr_api_key_id and scalr_api_key_secret
|
17
|
-
**Required except on macOS and Windows** These are respectively the API KEY ID and API KEY secret used to make the API calls to Scalr. This option **SHOULD NOT** be used on Windows and macOS because kitchen scalr integrates natively with these OSes to ensure secure storage of the Scalr credentials. In this case, Scalr will prompt for credentials at the first use, and memorize them for further calls.
|
19
|
+
**Required except on macOS and Windows** These are respectively the API KEY ID and API KEY secret used to make the API calls to Scalr. This option **SHOULD NOT** be used on Windows and macOS because kitchen scalr integrates natively with these OSes to ensure secure storage of the Scalr credentials. In this case, Kitchen-Scalr will prompt for credentials at the first use, and memorize them for further calls.
|
18
20
|
### scalr_project_id
|
19
21
|
**Required** This is a string corresponding to the project identifier used to create the farm in Scalr. This is used in Scalr for accountability and cost management.
|
20
22
|
### scalr_use_role
|
@@ -27,6 +29,8 @@ Please read the [Driver usage][driver_usage] page for more details.
|
|
27
29
|
**Required in Role mode** This is the identifier of the underlying cloud platform. Examples: "ec2", "gce", "openstack".
|
28
30
|
### scalr_location
|
29
31
|
**Required in Role mode** This is a string corresponding to the cloud location used to create the instance. Example: "us-east-1"
|
32
|
+
### scalr_permit_ssh_root_login
|
33
|
+
**Optional** This is a boolean, default is 'false', that configures sshd to allow root logins and bounces the service during kitchen create. Useful if your base image does not allow ssh as root by default.
|
30
34
|
### scalr_base_farm_role
|
31
35
|
**Optional** This is a yaml representation of a Farm Role Object as described in the APIv2 in Scalr. When kitchen-scalr creates a server, it merges this object with the previously-described parameters and creates the corresponding Farm Role. This section can be used to configure Security Groups, Networking etc... You can put the same parameters there as the ones you would get with a `scalr-ctl farm-roles get`.
|
32
36
|
### scalr_use_private_ip
|
@@ -74,9 +78,14 @@ example:
|
|
74
78
|
4. Push to the branch (`git push origin my-new-feature`)
|
75
79
|
5. Create new Pull Request
|
76
80
|
|
81
|
+
## <a name="thanks"></a> Thanks
|
82
|
+
|
83
|
+
- @daxgames for contributing the 'permit_ssh_root_login' setting.
|
84
|
+
|
77
85
|
## <a name="authors"></a> Authors
|
78
86
|
|
79
|
-
Created
|
87
|
+
- Created by [Mohammed HAWARI][author] (<mohammed@hawari.fr>)
|
88
|
+
- Maintained by [Aloys AUGUSTIN][maintainer] (<aloys@scalr.com>)
|
80
89
|
|
81
90
|
## <a name="license"></a> License
|
82
91
|
|
@@ -84,8 +93,9 @@ Apache 2.0 (see [LICENSE][license])
|
|
84
93
|
|
85
94
|
|
86
95
|
[author]: https://github.com/momohawari
|
87
|
-
[
|
88
|
-
[
|
89
|
-
[
|
96
|
+
[maintainer]: https://github.com/aloysaugustin
|
97
|
+
[issues]: https://github.com/aloysaugustin/kitchen-scalr/issues
|
98
|
+
[license]: https://github.com/aloysaugustin/kitchen-scalr/blob/master/LICENSE
|
99
|
+
[repo]: https://github.com/aloysaugustin/kitchen-scalr
|
90
100
|
[driver_usage]: http://kitchen.ci/docs/getting-started/adding-platform
|
91
101
|
[chef_omnibus_dl]: http://www.chef.io/chef/install/
|
data/kitchen-scalr.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.description = %q{A Test Kitchen Driver for Scalr}
|
12
12
|
spec.summary = spec.description
|
13
13
|
spec.homepage = ''
|
14
|
-
spec.license = 'Apache
|
14
|
+
spec.license = 'Apache-2.0'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
17
|
spec.executables = []
|
data/lib/kitchen/driver/scalr.rb
CHANGED
@@ -71,6 +71,8 @@ module Kitchen
|
|
71
71
|
|
72
72
|
default_config :scalr_base_farm_role, Hash.new
|
73
73
|
|
74
|
+
default_config :scalr_permit_ssh_root_login, false
|
75
|
+
|
74
76
|
default_config :scalr_use_private_ip, false
|
75
77
|
|
76
78
|
def create(state)
|
@@ -125,8 +127,8 @@ module Kitchen
|
|
125
127
|
state[:hostname] = response[0]['publicIp'][0]
|
126
128
|
end
|
127
129
|
state[:ssh_key] = state[:keyfileName]
|
128
|
-
#state[:proxy_command] =
|
129
|
-
#state[:rdp_port] =
|
130
|
+
#state[:proxy_command] =
|
131
|
+
#state[:rdp_port] =
|
130
132
|
end
|
131
133
|
|
132
134
|
def cleanup_scalr(scalr_api, state)
|
@@ -243,17 +245,17 @@ module Kitchen
|
|
243
245
|
#Create a matching role on the fly
|
244
246
|
ruuid = 'KITCHEN-ROLE-' + state[:suuid]
|
245
247
|
roleObject = {
|
246
|
-
"builtinAutomation" => ["base"],
|
248
|
+
"builtinAutomation" => ["base"],
|
247
249
|
"category" => {
|
248
250
|
"id" => 1
|
249
|
-
},
|
250
|
-
"deprecated" => false,
|
251
|
-
"description" => "test kitchen role",
|
252
|
-
"name" => ruuid,
|
251
|
+
},
|
252
|
+
"deprecated" => false,
|
253
|
+
"description" => "test kitchen role",
|
254
|
+
"name" => ruuid,
|
253
255
|
"os" => {
|
254
256
|
"id" => state[:imageOsId]
|
255
|
-
},
|
256
|
-
"quickStart" => false,
|
257
|
+
},
|
258
|
+
"quickStart" => false,
|
257
259
|
"useScalrAgent" => true
|
258
260
|
}
|
259
261
|
puts 'Creating a role with name %s' % [ruuid]
|
@@ -286,6 +288,9 @@ module Kitchen
|
|
286
288
|
res = `yes | ssh-keygen -q -f #{keyfileName} -N ""`
|
287
289
|
f = File.open(keyfileName + ".pub")
|
288
290
|
scriptData = Kitchen::Driver::SCALR_SSH_SCRIPT % { :ssh_pub_key => f.read }
|
291
|
+
if config[:scalr_permit_ssh_root_login]
|
292
|
+
scriptData += Kitchen::Driver::SCALR_SSH_ROOT_PERMIT_SCRIPT
|
293
|
+
end
|
289
294
|
f.close
|
290
295
|
state[:scriptOsType] = "linux"
|
291
296
|
else
|
@@ -1,10 +1,25 @@
|
|
1
|
+
require 'kitchen'
|
2
|
+
|
1
3
|
module Kitchen
|
2
4
|
module Driver
|
3
5
|
|
4
|
-
SCALR_SSH_SCRIPT =
|
5
|
-
'#!/bin/bash
|
6
|
+
SCALR_SSH_SCRIPT = '#!/bin/bash
|
6
7
|
cat >> /root/.ssh/authorized_keys << EOF
|
7
8
|
%{ssh_pub_key}
|
8
|
-
EOF
|
9
|
+
EOF
|
10
|
+
'
|
11
|
+
|
12
|
+
SCALR_SSH_ROOT_PERMIT_SCRIPT = '
|
13
|
+
sed -i \'s/^\(PermitRootLogin\)\s*no/\1 yes/g\' /etc/ssh/sshd_config
|
14
|
+
|
15
|
+
if command -v systemctl >/dev/null 2>&1; then
|
16
|
+
systemctl restart sshd
|
17
|
+
elif [ -f /etc/init.d/ssh ]; then
|
18
|
+
/etc/init.d/ssh restart
|
19
|
+
elif [ -f /etc/init.d/sshd ]; then
|
20
|
+
/etc/init.d/sshd restart
|
21
|
+
fi
|
22
|
+
'
|
23
|
+
|
9
24
|
end
|
10
|
-
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-scalr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mohammed HAWARI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -163,7 +163,7 @@ files:
|
|
163
163
|
- lib/kitchen/driver/scalr_version.rb
|
164
164
|
homepage: ''
|
165
165
|
licenses:
|
166
|
-
- Apache
|
166
|
+
- Apache-2.0
|
167
167
|
metadata: {}
|
168
168
|
post_install_message:
|
169
169
|
rdoc_options: []
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
183
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.6.
|
184
|
+
rubygems_version: 2.6.11
|
185
185
|
signing_key:
|
186
186
|
specification_version: 4
|
187
187
|
summary: A Test Kitchen Driver for Scalr
|