spaux 0.0.1 → 0.0.2
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 +4 -4
- data/examples/attributes.json +11 -20
- data/examples/knife.rb +6 -0
- data/lib/spaux/cli.rb +27 -0
- data/lib/spaux/version.rb +1 -1
- data/spec/spaux_spec.rb +5 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c2a52a8929cfd462d77814d9b080ca8e282d740
|
4
|
+
data.tar.gz: 5594916e7f5c25b2e54d92dd885a67cc0aa4d14a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c310e8a8abe5b70067a267b53c90f3105d32bdde096cb8c6dc788b677b0b1ec95c55558416b5028c828c7421a1abe47b638d7d1cccd4a3d5b12f8c079be2a662
|
7
|
+
data.tar.gz: 923c4039a0bbd5f4f0c40840495225e08114830130e4ebdea52a9d71edbf5ad4ec417f58f7afb336c01e8cdc51abfe29d2a633919807c8c77b2895d61bb33411
|
data/examples/attributes.json
CHANGED
@@ -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
|
-
"
|
4
|
+
"action":"converge",
|
5
|
+
"key_name":"fancy",
|
6
|
+
"name":"xanadu",
|
12
7
|
"runlist":[
|
13
|
-
"
|
8
|
+
"ufw",
|
14
9
|
"hostname",
|
10
|
+
"apt",
|
15
11
|
"git",
|
16
|
-
"ufw",
|
17
12
|
"users::sysadmins",
|
18
13
|
"sudo"
|
19
|
-
]
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
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
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.
|
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
|