vagrant-zanzibar 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +39 -44
- data/lib/vagrant-zanzibar/version.rb +1 -1
- data/lib/vagrant-zanzibar.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# Zanzibar
|
2
|
-
[![Gem Version](https://badge.fury.io/rb/zanzibar.svg)](http://badge.fury.io/rb/zanzibar)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/vagrant-zanzibar.svg)](http://badge.fury.io/rb/vagrant-zanzibar)
|
3
3
|
|
4
|
-
|
4
|
+
vagrant-zanzibar is a fork of zanzibar intended to work with Vagrant environments to retrieve secrets from a Secret Server installation. It supports retrieval of a password, public/private key, or secret attachment.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
10
|
```ruby
|
11
|
-
gem 'zanzibar'
|
11
|
+
gem 'vagrant-zanzibar'
|
12
12
|
```
|
13
13
|
|
14
14
|
And then execute:
|
@@ -17,57 +17,52 @@ And then execute:
|
|
17
17
|
|
18
18
|
Or install it yourself as:
|
19
19
|
|
20
|
-
$ gem install zanzibar
|
20
|
+
$ gem install vagrant-zanzibar
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
|
24
|
+
Here is an example Vagrantfile, using vagrant-orchestrate.
|
25
25
|
|
26
26
|
```ruby
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
```bash
|
61
|
-
# if you don't pipe in a password, you will be prompted to enter one.
|
62
|
-
# this will download the private key from secret 1984 to the current directory
|
63
|
-
cat ./local-password | zanzibar 1984 -s server.example.com -d example.com -t privatekey
|
27
|
+
require 'vagrant-zanzibar'
|
28
|
+
|
29
|
+
zanzibar = Zanzibar::Zanzibar.new(:wsdl => "https://mysecretserver.com/webservices/sswebservice.asmx?wsdl", :domain => 'mydomain.net')
|
30
|
+
|
31
|
+
managed_servers = %w( myserver1.net )
|
32
|
+
|
33
|
+
required_plugins = %w( vagrant-managed-servers vagrant-triggers vagrant-zanzibar)
|
34
|
+
required_plugins.each do |plugin|
|
35
|
+
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
|
36
|
+
end
|
37
|
+
Vagrant.configure("2") do |config|
|
38
|
+
config.ssh.username = "user"
|
39
|
+
config.ssh.private_key_path = zanzibar.download_secret_file(:scrt_id => 1234, :type => "Private Key")
|
40
|
+
|
41
|
+
config.trigger.before :provision do
|
42
|
+
# This password needs to be checked out
|
43
|
+
zanzibar.get_password(3456)
|
44
|
+
end
|
45
|
+
|
46
|
+
config.trigger.after :destroy do
|
47
|
+
zanzibar.check_in_secrets
|
48
|
+
end
|
49
|
+
|
50
|
+
managed_servers.each do |instance|
|
51
|
+
config.vm.define "managed-#{instance}" do |box|
|
52
|
+
box.vm.box = "tknerr/managed-server-dummy"
|
53
|
+
box.vm.box_url = "./dummy.box"
|
54
|
+
box.vm.provider :managed do |provider|
|
55
|
+
provider.server = instance
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
64
60
|
|
65
|
-
ssh user@someremote -i ./private_key
|
66
61
|
```
|
67
62
|
|
68
63
|
## Contributing
|
69
64
|
|
70
|
-
1. Fork it ( https://github.com/Cimpress-MCP/zanzibar/fork )
|
65
|
+
1. Fork it ( https://github.com/Cimpress-MCP/vagrant-zanzibar/fork )
|
71
66
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
72
67
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
73
68
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/vagrant-zanzibar.rb
CHANGED
@@ -86,7 +86,7 @@ module Zanzibar
|
|
86
86
|
def check_in_secrets
|
87
87
|
failures = []
|
88
88
|
token = get_token
|
89
|
-
@@secrets.each do |secret_id|
|
89
|
+
@@secrets.uniq.each do |secret_id|
|
90
90
|
begin
|
91
91
|
response = @@client.request(:wsdl, :check_in) { soap.body = { token: token, secretId: secret_id} }
|
92
92
|
.hash[:envelope][:body][:check_in_response][:check_in_result][:errors]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-zanzibar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -138,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
segments:
|
140
140
|
- 0
|
141
|
-
hash:
|
141
|
+
hash: -429271053
|
142
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
143
|
none: false
|
144
144
|
requirements:
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
segments:
|
149
149
|
- 0
|
150
|
-
hash:
|
150
|
+
hash: -429271053
|
151
151
|
requirements: []
|
152
152
|
rubyforge_project:
|
153
153
|
rubygems_version: 1.8.24
|