avst-cloud 0.1.20 → 0.1.21
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 +8 -8
- data/avst-cloud.gemspec +1 -1
- data/lib/avst-cloud/azure_rm_connection.rb +2 -2
- data/lib/avst-cloud/logging.rb +21 -9
- data/lib/avst-cloud/rackspace_connection.rb +2 -2
- data/lib/avst-cloud/task.rb +3 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjNlODExNDZjNDRmNTg4MzkyYzFmMzBhM2I1Njg4YjdkZTFkODk0Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTkyMDI2YThlNmUxNjgyODFmNmQ2MGQwZTYyOWE0NmRkMTEzYjdlMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2ZkMDA3NTE0MjI4ZTliNGFlZDkzYzU2NjI1OGRiZmEyNTBkZDhhODcyN2I4
|
10
|
+
ZDlkZmZlYjM4YThlZmVhOTY4M2M1NGMwY2FjMmM5NGRjM2I1YjhiMjIyMTMx
|
11
|
+
YmJjZmViY2IxYzhiNTY0NzU2ZTQwYzg2MjdiNWQyMDkyMDc5ODA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmYwNTJlZDQ4MDFlMWEzNGI0ODI2NmNkMjQ1NDUzOTRhNTYwMWZmODE3MzRj
|
14
|
+
ODBhNzQzNWZjMzU2YjM3YmIyOGMwZWEwNTczZGFiY2VhMjI5YzZlMjVmMTk5
|
15
|
+
M2U5MThiNTQ0ZDFhYzlmNTNmNzU2ZTVhNGU3OGJkMTI2YTk3MGM=
|
data/avst-cloud.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "avst-cloud"
|
7
|
-
spec.version = '0.1.
|
7
|
+
spec.version = '0.1.21'
|
8
8
|
spec.authors = ["Martin Brehovsky", "Jon Bevan", "Matthew Hope"]
|
9
9
|
spec.email = ["mbrehovsky@adaptavist.com", "jbevan@adaptavist.com", "mhope@adaptavist.com"]
|
10
10
|
spec.summary = %q{Automated creation, bootstrapping and provisioning of servers }
|
@@ -115,7 +115,7 @@ module AvstCloud
|
|
115
115
|
logger.debug "storage_account_name - #{storage_account_name}"
|
116
116
|
logger.debug "vm_size - #{vm_size}"
|
117
117
|
logger.debug "user - #{user}"
|
118
|
-
logger.debug "password - #{password}"
|
118
|
+
logger.debug "password - #{Logging.mask_message(password)}"
|
119
119
|
logger.debug "publisher - #{publisher}"
|
120
120
|
logger.debug "offer - #{offer}"
|
121
121
|
logger.debug "sku - #{sku}"
|
@@ -171,7 +171,7 @@ module AvstCloud
|
|
171
171
|
result_server = AvstCloud::AzureRmServer.new(server, server_name, ip_address, user, password)
|
172
172
|
logger.debug "[DONE]\n\n"
|
173
173
|
logger.debug "The server has been successfully created, to login onto the server:\n"
|
174
|
-
logger.debug "\t ssh #{user}@#{ip_address} with pass #{password} \n"
|
174
|
+
logger.debug "\t ssh #{user}@#{ip_address} with pass #{Logging.mask_message(password)} \n"
|
175
175
|
result_server
|
176
176
|
end
|
177
177
|
end
|
data/lib/avst-cloud/logging.rb
CHANGED
@@ -15,22 +15,34 @@
|
|
15
15
|
require 'logger'
|
16
16
|
|
17
17
|
module Logging
|
18
|
+
|
19
|
+
def self.logger
|
20
|
+
@logger ||= Logger.new(STDOUT)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.logger=(logger)
|
24
|
+
@logger = logger
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.show_passwords=(show_passwords)
|
28
|
+
@show_passwords = show_passwords
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.mask_message(message)
|
32
|
+
!@show_passwords ? "*****" : message
|
33
|
+
end
|
34
|
+
|
35
|
+
# Addition
|
18
36
|
def self.included(base)
|
19
37
|
class << base
|
20
38
|
def logger
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
def logger=(logger)
|
25
|
-
@logger = logger
|
39
|
+
Logging.logger
|
26
40
|
end
|
27
41
|
end
|
28
42
|
end
|
29
43
|
|
30
44
|
def logger
|
31
|
-
|
32
|
-
end
|
33
|
-
def logger=(logger)
|
34
|
-
@logger = logger
|
45
|
+
Logging.logger
|
35
46
|
end
|
47
|
+
|
36
48
|
end
|
@@ -78,7 +78,7 @@ module AvstCloud
|
|
78
78
|
logger.debug "You can continute to monitor the build process through the web console at https://mycloud.rackspace.com/\n\n"
|
79
79
|
raise "Timeout while creating Rackspace server #{server_name}"
|
80
80
|
end
|
81
|
-
logger.debug "The #{server.username} password is #{server.password}\n\n"
|
81
|
+
logger.debug "The #{server.username} password is #{Logging.mask_message(server.password)}\n\n"
|
82
82
|
end
|
83
83
|
result_server.access_user = server.username
|
84
84
|
result_server.access_password = server.password
|
@@ -126,7 +126,7 @@ module AvstCloud
|
|
126
126
|
private
|
127
127
|
def connect
|
128
128
|
unless @connection
|
129
|
-
logger.debug "Creating new connection to rackspace: #{@provider_user} #{@provider_pass} #{@region}"
|
129
|
+
logger.debug "Creating new connection to rackspace: #{@provider_user} #{Logging.mask_message(@provider_pass)} #{@region}"
|
130
130
|
@connection = Fog::Compute.new({
|
131
131
|
:provider => 'rackspace',
|
132
132
|
:rackspace_username => @provider_access_user,
|
data/lib/avst-cloud/task.rb
CHANGED
@@ -26,7 +26,6 @@ module AvstCloud
|
|
26
26
|
end
|
27
27
|
|
28
28
|
class SshTask < AvstCloud::Task
|
29
|
-
include Logging
|
30
29
|
def execute(server)
|
31
30
|
unless server.ip_address
|
32
31
|
logger.error 'Can not find host'.red
|
@@ -43,7 +42,7 @@ module AvstCloud
|
|
43
42
|
raise 'Password not found. Please provide root_password in config. for this server.'
|
44
43
|
end
|
45
44
|
|
46
|
-
logger.debug "Using #{server.access_user}@#{server.ip_address} with #{server.access_password} to perform ssh task."
|
45
|
+
logger.debug "Using #{server.access_user}@#{server.ip_address} with #{Logging.mask_message(server.access_password)} to perform ssh task."
|
47
46
|
attempts = 1
|
48
47
|
success = false
|
49
48
|
max_attempts = 50
|
@@ -71,8 +70,6 @@ module AvstCloud
|
|
71
70
|
end
|
72
71
|
|
73
72
|
class SshCommandTask < AvstCloud::SshTask
|
74
|
-
include Logging
|
75
|
-
|
76
73
|
def initialize(cmds, debug = false, structured_log = false)
|
77
74
|
@cmds = cmds
|
78
75
|
@debug = debug
|
@@ -107,7 +104,6 @@ module AvstCloud
|
|
107
104
|
# for user that performs it
|
108
105
|
# In case user does not have sudo no pass, enable it for bootstrapping and provisioning
|
109
106
|
class DisableRequireTty < AvstCloud::SshTask
|
110
|
-
include Logging
|
111
107
|
def initialize(for_user, pass, enable_passwordless_sudo=false)
|
112
108
|
@for_user = for_user
|
113
109
|
@user_password = pass
|
@@ -153,7 +149,6 @@ module AvstCloud
|
|
153
149
|
end
|
154
150
|
|
155
151
|
class WaitUntilReady < AvstCloud::SshTask
|
156
|
-
include Logging
|
157
152
|
|
158
153
|
def ssh_command(session)
|
159
154
|
session.open_channel do |channel|
|
@@ -180,7 +175,6 @@ module AvstCloud
|
|
180
175
|
end
|
181
176
|
|
182
177
|
class CapistranoDeploymentTask < AvstCloud::Task
|
183
|
-
include Logging
|
184
178
|
|
185
179
|
def initialize(git, branch, server_tmp_folder = "/tmp/avst_cloud_tmp_#{Time.now.to_i}", reference = nil, custom_provisioning_commands = [], puppet_runner = nil, puppet_runner_prepare = nil, destination_folder = '/var/opt/puppet')
|
186
180
|
unless git and (branch or reference)
|
@@ -214,8 +208,7 @@ module AvstCloud
|
|
214
208
|
raise 'Password not found. Please provide root_password in config. for this server.'
|
215
209
|
end
|
216
210
|
|
217
|
-
logger.debug "Using #{server.access_user}@#{server.ip_address} with #{server.access_password}"
|
218
|
-
|
211
|
+
logger.debug "Using #{server.access_user}@#{server.ip_address} with #{Logging.mask_message(server.access_password)}"
|
219
212
|
|
220
213
|
# Initiate capistrano deploy script to download the laters code and provision the server
|
221
214
|
require 'capistrano/all'
|
@@ -264,7 +257,6 @@ module AvstCloud
|
|
264
257
|
end
|
265
258
|
|
266
259
|
class ScpTask < AvstCloud::Task
|
267
|
-
include Logging
|
268
260
|
|
269
261
|
def initialize(files)
|
270
262
|
@files = files
|
@@ -286,7 +278,7 @@ module AvstCloud
|
|
286
278
|
raise 'Password not found. Please provide root_password in config. for this server.'
|
287
279
|
end
|
288
280
|
|
289
|
-
logger.debug "Using #{server.access_user}@#{server.ip_address} with #{server.access_password}"
|
281
|
+
logger.debug "Using #{server.access_user}@#{server.ip_address} with #{Logging.mask_message(server.access_password)}"
|
290
282
|
Net::SCP.start( server.ip_address, server.access_user, :password => server.access_password, :keys => [server.access_password] ) do |scp|
|
291
283
|
@files.each do |local_file, remote_path|
|
292
284
|
upload_file(scp, local_file, remote_path)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avst-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Brehovsky
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-10-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|