Skip to content

Commit ef8873e

Browse files
committed
Initial source import
0 parents  commit ef8873e

15 files changed

+703
-0
lines changed

.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format documentation

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
rvm:
2+
- 1.9.3
3+
- 2.0.0
4+
- 2.1.0
5+
6+
bundler_args: --jobs 7

Berksfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://supermarket.getchef.com"
2+
3+
metadata

Berksfile.lock

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DEPENDENCIES
2+
ssh-keys
3+
path: .
4+
metadata: true
5+
6+
GRAPH
7+
ssh-keys (0.1.0)

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.1.0
2+
3+
Initial release of ssh-keys

Gemfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'berkshelf'
4+
5+
group :development do
6+
gem 'chef', '~> 11.16'
7+
gem 'chefspec'
8+
gem 'rake'
9+
end

Gemfile.lock

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.3.6)
5+
berkshelf (3.2.1)
6+
addressable (~> 2.3.4)
7+
berkshelf-api-client (~> 1.2)
8+
buff-config (~> 1.0)
9+
buff-extensions (~> 1.0)
10+
buff-shell_out (~> 0.1)
11+
celluloid (~> 0.16.0)
12+
celluloid-io (~> 0.16.1)
13+
cleanroom (~> 1.0)
14+
faraday (~> 0.9.0)
15+
minitar (~> 0.5.4)
16+
octokit (~> 3.0)
17+
retryable (~> 1.3.3)
18+
ridley (~> 4.0)
19+
solve (~> 1.1)
20+
thor (~> 0.19)
21+
berkshelf-api-client (1.2.0)
22+
faraday (~> 0.9.0)
23+
buff-config (1.0.1)
24+
buff-extensions (~> 1.0)
25+
varia_model (~> 0.4)
26+
buff-extensions (1.0.0)
27+
buff-ignore (1.1.1)
28+
buff-ruby_engine (0.1.0)
29+
buff-shell_out (0.2.0)
30+
buff-ruby_engine (~> 0.1.0)
31+
celluloid (0.16.0)
32+
timers (~> 4.0.0)
33+
celluloid-io (0.16.1)
34+
celluloid (>= 0.16.0)
35+
nio4r (>= 1.0.0)
36+
chef (11.16.4)
37+
chef-zero (~> 2.1, >= 2.1.4)
38+
diff-lcs (~> 1.2, >= 1.2.4)
39+
erubis (~> 2.7)
40+
ffi-yajl (~> 1.0)
41+
highline (~> 1.6, >= 1.6.9)
42+
mime-types (~> 1.16)
43+
mixlib-authentication (~> 1.3)
44+
mixlib-cli (~> 1.4)
45+
mixlib-config (~> 2.0)
46+
mixlib-log (~> 1.3)
47+
mixlib-shellout (~> 1.4)
48+
net-ssh (~> 2.6)
49+
net-ssh-multi (~> 1.1)
50+
ohai (~> 7.4)
51+
plist (~> 3.1.0)
52+
pry (~> 0.9)
53+
rest-client (>= 1.0.4, <= 1.6.7)
54+
chef-zero (2.2.1)
55+
ffi-yajl (~> 1.1)
56+
hashie (~> 2.0)
57+
mixlib-log (~> 1.3)
58+
rack
59+
chefspec (4.1.1)
60+
chef (>= 11.14)
61+
fauxhai (~> 2.0)
62+
rspec (~> 3.0)
63+
cleanroom (1.0.0)
64+
coderay (1.1.0)
65+
dep-selector-libgecode (1.0.2)
66+
dep_selector (1.0.3)
67+
dep-selector-libgecode (~> 1.0)
68+
ffi (~> 1.9)
69+
diff-lcs (1.2.5)
70+
erubis (2.7.0)
71+
faraday (0.9.0)
72+
multipart-post (>= 1.2, < 3)
73+
fauxhai (2.2.0)
74+
net-ssh
75+
ohai
76+
ffi (1.9.6)
77+
ffi-yajl (1.3.1)
78+
ffi (~> 1.5)
79+
libyajl2 (~> 1.2)
80+
hashie (2.1.2)
81+
highline (1.6.21)
82+
hitimes (1.2.2)
83+
ipaddress (0.8.0)
84+
json (1.8.1)
85+
libyajl2 (1.2.0)
86+
method_source (0.8.2)
87+
mime-types (1.25.1)
88+
minitar (0.5.4)
89+
mixlib-authentication (1.3.0)
90+
mixlib-log
91+
mixlib-cli (1.5.0)
92+
mixlib-config (2.1.0)
93+
mixlib-log (1.6.0)
94+
mixlib-shellout (1.6.1)
95+
multipart-post (2.0.0)
96+
net-http-persistent (2.9.4)
97+
net-ssh (2.9.1)
98+
net-ssh-gateway (1.2.0)
99+
net-ssh (>= 2.6.5)
100+
net-ssh-multi (1.2.0)
101+
net-ssh (>= 2.6.5)
102+
net-ssh-gateway (>= 1.2.0)
103+
nio4r (1.0.1)
104+
octokit (3.7.0)
105+
sawyer (~> 0.6.0, >= 0.5.3)
106+
ohai (7.4.0)
107+
ffi (~> 1.9)
108+
ffi-yajl (~> 1.0)
109+
ipaddress
110+
mime-types (~> 1.16)
111+
mixlib-cli
112+
mixlib-config (~> 2.0)
113+
mixlib-log
114+
mixlib-shellout (~> 1.2)
115+
systemu (~> 2.6.4)
116+
wmi-lite (~> 1.0)
117+
plist (3.1.0)
118+
pry (0.10.1)
119+
coderay (~> 1.1.0)
120+
method_source (~> 0.8.1)
121+
slop (~> 3.4)
122+
rack (1.5.2)
123+
rake (10.4.2)
124+
rest-client (1.6.7)
125+
mime-types (>= 1.16)
126+
retryable (1.3.6)
127+
ridley (4.1.1)
128+
addressable
129+
buff-config (~> 1.0)
130+
buff-extensions (~> 1.0)
131+
buff-ignore (~> 1.1)
132+
buff-shell_out (~> 0.1)
133+
celluloid (~> 0.16.0)
134+
celluloid-io (~> 0.16.1)
135+
erubis
136+
faraday (~> 0.9.0)
137+
hashie (>= 2.0.2, < 3.0.0)
138+
json (>= 1.7.7)
139+
mixlib-authentication (>= 1.3.0)
140+
net-http-persistent (>= 2.8)
141+
retryable
142+
semverse (~> 1.1)
143+
varia_model (~> 0.4)
144+
rspec (3.1.0)
145+
rspec-core (~> 3.1.0)
146+
rspec-expectations (~> 3.1.0)
147+
rspec-mocks (~> 3.1.0)
148+
rspec-core (3.1.7)
149+
rspec-support (~> 3.1.0)
150+
rspec-expectations (3.1.2)
151+
diff-lcs (>= 1.2.0, < 2.0)
152+
rspec-support (~> 3.1.0)
153+
rspec-mocks (3.1.3)
154+
rspec-support (~> 3.1.0)
155+
rspec-support (3.1.2)
156+
sawyer (0.6.0)
157+
addressable (~> 2.3.5)
158+
faraday (~> 0.8, < 0.10)
159+
semverse (1.2.1)
160+
slop (3.6.0)
161+
solve (1.2.1)
162+
dep_selector (~> 1.0)
163+
semverse (~> 1.1)
164+
systemu (2.6.4)
165+
thor (0.19.1)
166+
timers (4.0.1)
167+
hitimes
168+
varia_model (0.4.0)
169+
buff-extensions (~> 1.0)
170+
hashie (>= 2.0.2, < 3.0.0)
171+
wmi-lite (1.0.0)
172+
173+
PLATFORMS
174+
ruby
175+
176+
DEPENDENCIES
177+
berkshelf
178+
chef (~> 11.16)
179+
chefspec
180+
rake

README.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# ssh-keys-cookbook
2+
3+
Deploys SSH keys
4+
5+
## Supported Platforms
6+
7+
* CentOS 6.5
8+
* Debian 7
9+
10+
## Attributes
11+
12+
| Key | Type | Default | Description |
13+
| :---------- |:---------- | :--------- | :---------------------------------------------------- |
14+
| `databag` | String | `ssh_keys` | Databag where to search for keys |
15+
| `users` | Hash | `{}` | A list of users with names as key |
16+
17+
### Users
18+
19+
| Key | Type | Default | Description |
20+
| :------------------ |:---------- | :--------- | :------------------------------------------------------- |
21+
| `databag` | String | `ssh_keys` | Databag where to search for keys |
22+
| `authorized_keys` | Array | `[]` | Array of strings representing authorized SSH public keys |
23+
24+
## Databag
25+
26+
The databag is an `Hash` with usernames as keys. Each user can have a list of keypairs (as an `Array`).
27+
A keypais is described as follow:
28+
29+
| Key | Type | Default | Description |
30+
| :------|:------ | :------ | :------------------------- |
31+
| `id` | String | `nil` | Arbitrary name for the key |
32+
| `priv` | String | `nil` | Public key content |
33+
| `pub` | String | `nil` | Private key content |
34+
35+
## Usage
36+
37+
### ssh-keys::default
38+
39+
Include `ssh-keys` in your node's `run_list`:
40+
41+
```json
42+
{
43+
"run_list": [
44+
"recipe[ssh-keys]"
45+
]
46+
}
47+
```
48+
49+
#### Example databag
50+
51+
```json
52+
{
53+
"bob": [
54+
{
55+
"id": "my_key",
56+
"pub": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmz4D...",
57+
"priv": [
58+
"-----BEGIN RSA PRIVATE KEY-----",
59+
"MIIEpgIBAAKCAQEA5s+A461t/v8mQB9UQpaYwGWNl...",
60+
"...",
61+
"-----END RSA PRIVATE KEY-----"
62+
]
63+
},
64+
{
65+
"id": "my_other_key",
66+
"pub": "ssh-rsa sFE5JafGV4UmfxGP5/vpWC8HcoQAyYT...",
67+
"priv": [
68+
"-----BEGIN RSA PRIVATE KEY-----",
69+
"XFQg/FfgRC+rwooxKXsxqjA/zapfkzFVBchsjmYpx...",
70+
"...",
71+
"-----END RSA PRIVATE KEY-----"
72+
]
73+
}
74+
]
75+
}
76+
77+
```

Rakefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'rspec/core/rake_task'
2+
3+
RSpec::Core::RakeTask.new(:unit) do |task|
4+
task.rspec_opts = [].tap do |a|
5+
a.push('--color')
6+
a.push('--format documentation')
7+
end.join(' ')
8+
end
9+
10+
desc 'Run all tests'
11+
task :test => [:unit]
12+
13+
task :default => [:test]

attributes/default.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
default['ssh_keys']['databag'] = 'ssh_keys'
2+
default['ssh_keys']['users'] = []

0 commit comments

Comments
 (0)