spaux 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c50308cb66f6b1d4cfd64255d28a288fcc76719
4
- data.tar.gz: 9c9c2e3a42e4319be7db0bfa484f36419d625d8f
3
+ metadata.gz: 8c2a52a8929cfd462d77814d9b080ca8e282d740
4
+ data.tar.gz: 5594916e7f5c25b2e54d92dd885a67cc0aa4d14a
5
5
  SHA512:
6
- metadata.gz: 73a2d181a03ca651502f506b38fd5023b55ea34226b1018c80bbcfdc2515d1162fa03b35b8b5a25e30303cfb989f5f06191a1c00c4f9ef952bcea91ec5c051c9
7
- data.tar.gz: a3f2a933510fd6a7252e286c441bddfc854e5a22b371d5b08accd5e9b69e9231d223a6ee63f546e9c3cd16b24be272b91c463281d4592191acdd0d04119628e7
6
+ metadata.gz: c310e8a8abe5b70067a267b53c90f3105d32bdde096cb8c6dc788b677b0b1ec95c55558416b5028c828c7421a1abe47b638d7d1cccd4a3d5b12f8c079be2a662
7
+ data.tar.gz: 923c4039a0bbd5f4f0c40840495225e08114830130e4ebdea52a9d71edbf5ad4ec417f58f7afb336c01e8cdc51abfe29d2a633919807c8c77b2895d61bb33411
@@ -1,31 +1,22 @@
1
1
  {
2
- "action":"converge",
3
2
  "spaux":{
4
- "name":"xanadu",
5
- "digital_ocean":{
6
- "bootstrap_options":{
7
- "flavor_name":"512MB"
8
- }
9
- },
10
3
  "machine":{
11
- "with_rvm":false,
4
+ "action":"converge",
5
+ "key_name":"fancy",
6
+ "name":"xanadu",
12
7
  "runlist":[
13
- "apt",
8
+ "ufw",
14
9
  "hostname",
10
+ "apt",
15
11
  "git",
16
- "ufw",
17
12
  "users::sysadmins",
18
13
  "sudo"
19
- ],
20
- "attributes":{
21
- "firewall":{
22
- "rules":[
23
- {"http":{"port":"80"}},
24
- {"https":{"port":"443"}}
25
- ]
26
- }
14
+ ]
15
+ },
16
+ "digital_ocean":{
17
+ "bootstrap_options":{
18
+ "flavor_name":"512MB"
27
19
  }
28
20
  }
29
- },
30
- "override_key_name":"fancy"
21
+ }
31
22
  }
data/examples/knife.rb ADDED
@@ -0,0 +1,6 @@
1
+ current_dir = File.dirname(__FILE__)
2
+ node_name "spaux"
3
+ client_key ::File.join(current_dir, 'spaux.pem')
4
+ chef_server_url "https://api.opscode.com/organizations/spaux"
5
+ cookbook_path [current_dir]
6
+ ssl_verify_mode :verify_peer
data/lib/spaux/cli.rb CHANGED
@@ -25,5 +25,32 @@ class Spaux
25
25
  client = Spaux::Chef::Client.new(work_dir)
26
26
  client.run
27
27
  end
28
+ desc 'savekey', 'Show/save private chef key'
29
+ option :file, :type => :string
30
+ def savekey
31
+ key = Spaux::Chef::RawKey
32
+ if !options[:file]
33
+ puts key
34
+ else
35
+ ::File.write(options[:file], key)
36
+ end
37
+ end
38
+
39
+ # private
40
+ # def get_work_dir(options)
41
+ # dir = options[:dir]
42
+ # current = options[:current]
43
+ # if !dir
44
+ # work_dir = if ENV['SPAUX_HOME']
45
+ # ENV['SPAUX_HOME']
46
+ # elsif current
47
+ # ::File.join(ENV['PWD'], 'current')
48
+ # else
49
+ # Dir.mktmpdir
50
+ # end
51
+ # else
52
+ # work_dir = dir
53
+ # end
54
+ # end
28
55
  end
29
56
  end
data/lib/spaux/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Spaux
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/spec/spaux_spec.rb CHANGED
@@ -26,4 +26,9 @@ describe Spaux::CLI do
26
26
  expect { Spaux::CLI.new.converge }.to output(/Starting Chef Client/).to_stdout
27
27
  end
28
28
  end
29
+ describe '#savekey' do
30
+ it 'prints private key in stdout' do
31
+ expect { Spaux::CLI.new.savekey }.to output(/^-----BEGIN RSA PRIVATE KEY-----/).to_stdout
32
+ end
33
+ end
29
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Landaeta
@@ -179,6 +179,7 @@ files:
179
179
  - Rakefile
180
180
  - bin/spaux
181
181
  - examples/attributes.json
182
+ - examples/knife.rb
182
183
  - lib/spaux.rb
183
184
  - lib/spaux/chef/client.rb
184
185
  - lib/spaux/chef/key.rb