configspec 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/configspec/setup.rb +7 -6
- data/lib/configspec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d51d99b53d90945b732ab98ff1bdc76601db7346
|
4
|
+
data.tar.gz: c40dc4f8d3ee83ae404852176f111704b8726b0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bec1e4e9fa172bfe40641e0681f7a4d3cb66714b0486c14895abbc8ee0a1ec2e169c34bf8dc9b856fdd532322038bd6f7466a7a6c57d4dc70f24bb8b770882b5
|
7
|
+
data.tar.gz: 4554a6cf1271de53e05eb1bf31b210f07d35c58d8668b690149a0aec0106cddfc7fe264b7d552815b65e878a3fcc9cb32a655933e3eb46a7fe97b8ff879641e9
|
data/lib/configspec/setup.rb
CHANGED
@@ -32,7 +32,7 @@ module Configspec
|
|
32
32
|
print("Input target host name: ")
|
33
33
|
@hostname = $stdin.gets.chomp
|
34
34
|
end
|
35
|
-
|
35
|
+
elsif @backend_type == 'Exec'
|
36
36
|
@hostname = 'localhost'
|
37
37
|
end
|
38
38
|
|
@@ -65,6 +65,7 @@ Select a backend type:
|
|
65
65
|
|
66
66
|
1) SSH
|
67
67
|
2) Exec (local)
|
68
|
+
3) Dockerfile
|
68
69
|
|
69
70
|
Select number:
|
70
71
|
EOF
|
@@ -72,7 +73,7 @@ EOF
|
|
72
73
|
num = $stdin.gets.to_i - 1
|
73
74
|
puts
|
74
75
|
|
75
|
-
@backend_type = [ 'Ssh', 'Exec' ][num] || 'Exec'
|
76
|
+
@backend_type = [ 'Ssh', 'Exec', 'Dockerfile' ][num] || 'Exec'
|
76
77
|
end
|
77
78
|
|
78
79
|
def self.ask_windows_backend
|
@@ -201,7 +202,7 @@ EOF
|
|
201
202
|
def self.spec_helper_template
|
202
203
|
template = <<-EOF
|
203
204
|
require 'configspec'
|
204
|
-
<% if @os_type == 'UN*X' -%>
|
205
|
+
<% if @os_type == 'UN*X' and @backend_type != 'Dockerfile' -%>
|
205
206
|
require 'pathname'
|
206
207
|
<% end -%>
|
207
208
|
<% if @backend_type == 'Ssh' -%>
|
@@ -212,13 +213,13 @@ require 'winrm'
|
|
212
213
|
<% end -%>
|
213
214
|
|
214
215
|
include Configspec::Helper::<%= @backend_type %>
|
215
|
-
<% if @os_type == 'UN*X' -%>
|
216
|
+
<% if @os_type == 'UN*X' && @backend_type != 'Dockerfile' -%>
|
216
217
|
include Configspec::Helper::DetectOS
|
217
218
|
<% else -%>
|
218
|
-
include Configspec::Helper::
|
219
|
+
include Configspec::Helper::RedHat
|
219
220
|
<% end -%>
|
220
221
|
|
221
|
-
<% if @os_type == 'UN*X' -%>
|
222
|
+
<% if @os_type == 'UN*X' && @backend_type != 'Dockerfile' -%>
|
222
223
|
RSpec.configure do |c|
|
223
224
|
if ENV['ASK_SUDO_PASSWORD']
|
224
225
|
require 'highline/import'
|
data/lib/configspec/version.rb
CHANGED