sambot 0.1.112 → 0.1.113
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e27a0242225518e356de8ec660debdeed7ab5c07
|
4
|
+
data.tar.gz: 40c3677ed6d41aa92c5a4ffb902fd58246162e81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f714c9358725f402933712fde9a05a8568502d752dac1f33f7915a6ba45e6e58c9110cfd119bd838d0bb305af93e99d4dc1065f76bf534328c3c0c4dee9fe030
|
7
|
+
data.tar.gz: a9cfbfcff2b7991a3a4f7aef821e9dc461ade7d9130ee000d3e1edf3998992979c8baa0970e695de26d1e39efb66a99b570d8006ec7527117465fa6d3c7bd346
|
@@ -20,9 +20,9 @@ module Sambot
|
|
20
20
|
|
21
21
|
FORWARDS = {
|
22
22
|
'chef.brighter.io': { ip: '127.0.0.13', port: 443, local_port: 9013 },
|
23
|
-
'teamcity.brighter.io': { ip: '127.0.0.14', port:
|
24
|
-
'splunk.brighter.io': { ip: '127.0.0.15', port:
|
25
|
-
'jenkins.brighter.io': { ip: '127.0.0.16', port:
|
23
|
+
'teamcity.brighter.io': { ip: '127.0.0.14', port: 80, local_port: 9014 },
|
24
|
+
'splunk.brighter.io': { ip: '127.0.0.15', port: 80, local_port: 9015 },
|
25
|
+
'jenkins.brighter.io': { ip: '127.0.0.16', port: 80, local_port: 9016 },
|
26
26
|
'vault.brighter.io': { ip: '127.0.0.1', port: 8200, local_port: 9017 }
|
27
27
|
}
|
28
28
|
|
@@ -66,7 +66,7 @@ module Sambot
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def setup_secrets_management(username, password)
|
69
|
-
unless Vault.has_environment_variables?
|
69
|
+
unless Vault.has_environment_variables?(FORWARDS)
|
70
70
|
UI.info("You have either not configured your workstation or you have not opened up a new shell to pick up the changes applied during configuration")
|
71
71
|
end
|
72
72
|
UI.debug "Authenticating with Hashicorp Vault in Rackspace DEV/QE"
|
@@ -21,7 +21,7 @@ module Sambot
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.setup_environment(forwards, target = '~/.bash_profile')
|
24
|
+
def self.setup_environment(forwards, target = File.expand_path('~/.bash_profile'))
|
25
25
|
save_environment_variable('VAULT_SKIP_VERIFY', true, target)
|
26
26
|
save_environment_variable('VAULT_ADDR', build_vault_address(forwards), target)
|
27
27
|
end
|
@@ -30,7 +30,7 @@ module Sambot
|
|
30
30
|
"https://vault.brighter.io:#{forwards[:'vault.brighter.io'][:local_port]}"
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.save_environment_variable(key, value, target = '~/.bash_profile')
|
33
|
+
def self.save_environment_variable(key, value, target = File.expand_path('~/.bash_profile'))
|
34
34
|
contents = File.read(target)
|
35
35
|
contents = contents.gsub(/export #{key}=#{value}/, '') if has_environment_variable?(key, value, target)
|
36
36
|
contents << "export #{key}=#{value.to_s}\n"
|
@@ -38,18 +38,18 @@ module Sambot
|
|
38
38
|
ENV[key] = value.to_s
|
39
39
|
end
|
40
40
|
|
41
|
-
def self.has_environment_variables?(forwards, target = '~/.bash_profile')
|
41
|
+
def self.has_environment_variables?(forwards, target = File.expand_path('~/.bash_profile'))
|
42
42
|
has_vault_skip_verify = has_environment_variable?('VAULT_SKIP_VERIFY', true, target)
|
43
43
|
has_vault_addr = has_environment_variable?('VAULT_ADDR', build_vault_address(forwards), target)
|
44
44
|
(has_vault_addr != nil) && (has_vault_skip_verify != nil)
|
45
45
|
end
|
46
46
|
|
47
|
-
def self.has_environment_variable?(key, value, target = '~/.bash_profile')
|
47
|
+
def self.has_environment_variable?(key, value, target = File.expand_path('~/.bash_profile'))
|
48
48
|
contents = File.read(target)
|
49
49
|
contents.match(/export #{key}=#{value}/)
|
50
50
|
end
|
51
51
|
|
52
|
-
def self.save_token(token, home_directory = '~')
|
52
|
+
def self.save_token(token, home_directory = File.expand_path('~'))
|
53
53
|
File.write(File.expand_path(File.join(home_directory, '.vault-token')), token)
|
54
54
|
end
|
55
55
|
|
data/lib/sambot/version.rb
CHANGED