kraken 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/chef/knife/setup.rb +23 -0
- data/lib/chef/knife/var.rb +39 -0
- data/lib/kraken/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTBkMjZjYWM2MDU0Mjg0ZWM5MzE1NGU3NWZhZTIzOTMzMmY0NzM0Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWI0MGQyZjc4OWI3YTQ3MjM0ZmIyYzY3MDU3NjlmNjU4NWRjMWRlYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWYwZTExNDQzZjFkMzg4MjRhNDM1ZDQ2YjIxNWRjZjJiOWRmMmRiNjVjMTky
|
10
|
+
ZTEwMmIyMDljZWI4MDUzM2E5NTA5YzAzOWMxNGJmYjRlMjY3YjgzODA3Yzkw
|
11
|
+
OWY4YWNiODU4NzEwYzg4OGEyYmQ3NmZhZmEzMmE2N2M5Y2NlMDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjEyZTJkOWIwMDkxZGQzZTMwN2VlM2VlODlhNzEwYjhkMDdhNDQ3YmYwNWQw
|
14
|
+
M2Y4Mjg5NzhjNDkxNGI4NjA1MGVhMWQ3ZDlkOWFkZWRmZmQ0YjIwYjJjMzQ0
|
15
|
+
ZDkwNGZhMjcyODcwYzhjNzlkM2EwZDJkNWI3YmMyOTM4NWU4MWE=
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'chef/knife'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class Setup < Knife
|
6
|
+
banner 'knife setup'
|
7
|
+
|
8
|
+
def run
|
9
|
+
setup
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
def dir
|
14
|
+
"~/.chef"
|
15
|
+
end
|
16
|
+
|
17
|
+
def setup
|
18
|
+
`rm -rf #{dir}`
|
19
|
+
`git clone git@github.com:optimis/credentials.git #{dir}`
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'chef/knife'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class Var < Knife
|
6
|
+
attr_reader :configuration
|
7
|
+
|
8
|
+
deps do
|
9
|
+
require 'chef/config_fetcher'
|
10
|
+
end
|
11
|
+
|
12
|
+
banner 'knife var ENVIRONMENT KEY VALUE (options)'
|
13
|
+
|
14
|
+
def run
|
15
|
+
env, key, val = @name_args
|
16
|
+
current_vars = hash.dup
|
17
|
+
current_vars[key] = {} unless current_vars[key]
|
18
|
+
current_vars[key][env] = val
|
19
|
+
encrypted_vars = Chef::EncryptedDataBagItem.encrypt_data_bag_item current_vars, secret
|
20
|
+
updated_vars = Chef::DataBagItem.from_hash encrypted_vars
|
21
|
+
updated_vars.data_bag 'env'
|
22
|
+
updated_vars.save
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
def secret
|
27
|
+
Chef::EncryptedDataBagItem.load_secret config[:secret_file]
|
28
|
+
end
|
29
|
+
|
30
|
+
def item
|
31
|
+
Chef::EncryptedDataBagItem.load 'env', 'vars', secret rescue nil
|
32
|
+
end
|
33
|
+
|
34
|
+
def hash
|
35
|
+
item ? item.to_hash : { 'id' => 'vars' }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/kraken/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kraken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umang Chouhan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -95,6 +95,8 @@ files:
|
|
95
95
|
- Rakefile
|
96
96
|
- kraken.gemspec
|
97
97
|
- lib/chef/knife/deploy.rb
|
98
|
+
- lib/chef/knife/setup.rb
|
99
|
+
- lib/chef/knife/var.rb
|
98
100
|
- lib/kraken/version.rb
|
99
101
|
- spec/lib/kraken_spec.rb
|
100
102
|
- spec/spec_helper.rb
|