Skip to content

Commit d3b58d4

Browse files
committed
Rename cookbook
1 parent d882a75 commit d3b58d4

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

Berksfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
DEPENDENCIES
2-
ssh-keys
2+
user-ssh-keys
33
path: .
44
metadata: true
55

66
GRAPH
7-
ssh-keys (0.1.0)
7+
user-ssh-keys (1.0.0)

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ssh-keys-cookbook [![Build Status](https://travis-ci.org/pmsipilot/ssh-keys-cookbook.svg?branch=master)](https://travis-ci.org/pmsipilot/ssh-keys-cookbook)
1+
# user-ssh-keys-cookbook [![Build Status](https://travis-ci.org/pmsipilot/user-ssh-keys-cookbook.svg?branch=master)](https://travis-ci.org/pmsipilot/user-ssh-keys-cookbook)
22

33
Deploys SSH keys and authorized keys
44

@@ -9,6 +9,8 @@ Deploys SSH keys and authorized keys
99

1010
## Attributes
1111

12+
The root key of all attributes is `user_ssh_keys`.
13+
1214
| Key | Type | Default | Description |
1315
| :---------- |:---------- | :--------- | :---------------------------------------------------- |
1416
| `data_bag` | String | `ssh_keys` | Databag where to search for keys |
@@ -25,10 +27,10 @@ Deploys SSH keys and authorized keys
2527

2628
This cookbook provides one resource:
2729

28-
### `ssh_keys_key`
30+
### `user_ssh_keys_key`
2931

3032
```ruby
31-
ssh_keys_key 'john' do
33+
user_ssh_keys_key 'john' do
3234
authorized_keys [
3335
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmz4D...',
3436
'ssh-rsa sFE5JafGV4UmfxGP5/vpAAADWC8HcoQAyYT...'
@@ -55,19 +57,19 @@ A keypais is described as follow:
5557

5658
You can use this cookbook in tow ways:
5759

58-
* using the [default](#ssh-keys-default) recipe and providing (attributes)[#attributes]
60+
* using the [default](#user-ssh-keys-default) recipe and providing (attributes)[#attributes]
5961
* using the [LWRP](#lwrp)
6062

6163
Both methods require you to define a [databag](#databag) to define SSH key pairs. Defining attributes is not required if you only want to use the LWRP.
6264

63-
### ssh-keys::default
65+
### user-ssh-keys::default
6466

65-
Include `ssh-keys` in your node's `run_list`:
67+
Include `user-ssh-keys` in your node's `run_list`:
6668

6769
```json
6870
{
6971
"run_list": [
70-
"recipe[ssh-keys]"
72+
"recipe[user-ssh-keys]"
7173
]
7274
}
7375
```

attributes/default.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
default['ssh_keys']['data_bag'] = 'ssh_keys'
2-
default['ssh_keys']['users'] = []
1+
default['user_ssh_keys']['data_bag'] = 'ssh_keys'
2+
default['user_ssh_keys']['users'] = []

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name 'ssh-keys'
1+
name 'user-ssh-keys'
22
maintainer 'PMSIpilot'
33
maintainer_email '[email protected]'
44
license 'MIT'

recipes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node['ssh_keys']['users'].each do |username, user|
2-
ssh_keys_key username do
2+
user_ssh_keys_key username do
33
authorized_keys user['authorized_keys']
44
authorized_users user['authorized_users']
55
data_bag node['ssh_keys']['data_bag']

spec/unit/default_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
require 'spec_helper'
22

3-
describe 'ssh-keys::default' do
3+
describe 'user-ssh-keys::default' do
44
describe 'Deploys SSH keys' do
55
describe 'With one user' do
66
it 'Throws a ConfigurationError if user does not exist' do
7-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
7+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
88
node.set['ssh_keys'] = {
99
:users => {
1010
:bob => {}
@@ -23,7 +23,7 @@
2323
:keys => []
2424
})
2525

26-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
26+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
2727
node.set['ssh_keys'] = {
2828
:users => {
2929
:bob => {}
@@ -46,7 +46,7 @@
4646
:keys => []
4747
})
4848

49-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
49+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
5050
node.set['ssh_keys'] = {
5151
:users => {
5252
:bob => {}
@@ -72,7 +72,7 @@
7272
]
7373
})
7474

75-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
75+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
7676
node.set['ssh_keys'] = {
7777
:users => {
7878
:bob => {}
@@ -115,7 +115,7 @@
115115
]
116116
})
117117

118-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
118+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
119119
node.set['ssh_keys'] = {
120120
:users => {
121121
:bob => {}
@@ -154,7 +154,7 @@
154154

155155
describe 'With multiple users' do
156156
it 'Throws a ConfigurationError if user does not exist' do
157-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
157+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
158158
node.set['ssh_keys'] = {
159159
:users => {
160160
:bob => {
@@ -182,7 +182,7 @@
182182
:keys => []
183183
})
184184

185-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
185+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
186186
node.set['ssh_keys'] = {
187187
:users => {
188188
:bob => {
@@ -200,7 +200,7 @@
200200
describe 'Add authorized users' do
201201
describe 'With one user' do
202202
it 'Throws a ConfigurationError if user does not exist in databag' do
203-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
203+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
204204
node.set['ssh_keys'] = {
205205
:users => {
206206
:bob => {
@@ -239,7 +239,7 @@
239239
]
240240
})
241241

242-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
242+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
243243
node.set['ssh_keys'] = {
244244
:users => {
245245
:bob => {
@@ -283,7 +283,7 @@
283283
]
284284
})
285285

286-
chef_run = ChefSpec::SoloRunner.new(step_into: ['ssh_keys_key']) do |node|
286+
chef_run = ChefSpec::SoloRunner.new(step_into: ['user_ssh_keys_key']) do |node|
287287
node.set['ssh_keys'] = {
288288
:users => {
289289
:bob => {

0 commit comments

Comments
 (0)