cookbook 'ssh_user', '~> 0.1.1', :supermarket
ssh_user (2) Versions 0.1.1 Follow2
Manage basic global or user's ssh configurations.
cookbook 'ssh_user', '~> 0.1.1'
knife supermarket install ssh_user
knife supermarket download ssh_user
Chef SSH User
Manage basic global or user's ssh configurations.
Description
This cookbook features:
-
Provides Chef LWRP:
ssh_user_private_key
-
Includes ssh-util's Chef LWRP:
ssh_util_known_hosts
ssh_util_config
A companion recipe for user::data_bag.
Usage
Include recipe[ssh_user]
in your run_list
and ssh_user_private_key
resource will become available.
The ssh_user::data_bag
recipe assumes that you're using the user::data_bag
recipe from the excellent user cookbook. It lets you configure ssh aspects in user specific data_bags, e.g.
{
"id": "testman",
...
"ssh_user": {
"config": {
"github.com": {
"User": "git",
"IdentityFile": "~/.ssh/github_rsa"
}
},
"known_hosts": {
"github.com": {
"hashed": false
}
},
"private_keys": {
"github_rsa": "ABCD"
}
}
}
Requirements
Platform
This cookbook has been tested with the following OSes:
- ubuntu 12.04
Cookbooks
The cookbook has got the following dependencies:
Recipes
default
No-op, does nothing.
data_bag
Processes node['users']
and performs the configuration for the ones whose data_bags enable it, e.g.
{
"id" : "testman",
...
"ssh_user": {
"config": {
"github.com": {
"User": "git",
"IdentityFile": "~/.ssh/github_rsa"
}
},
"known_hosts": {
"github.com": {
"hashed": false
}
},
"private_keys": {
"github_rsa": "ABCD"
}
}
}
Resources and Providers
ssh_private_keys
Actions
<table> <thead> <tr> <th>Action</th> <th>Description</th> <th>Default</th> </tr> </thead> <tbody> <tr> <td>create</td> <td>Creates the user's <code>~/user/private_key</code> file.</td> <td>Yes</td> </tr> <tr> <td>delete</td> <td>Deletes the user's <code>~/user/private_key</code> file.</td> <td>No</td> </tr> </tbody> </table>
Attributes
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td><b>Name attribute:</b> Name of the key file.</td>
<td><code>nil</code></td>
<td>yes</td>
</tr>
<tr>
<td>key</td>
<td>A full line to add to the file.</td>
<td><code>nil</code></td>
<td>yes</td>
</tr>
<tr>
<td>user</td>
<td>An existing username.</td>
<td><code>nil</code></td>
<td>no</td>
</tr>
<tr>
<td>path</td>
<td>A full path to a where to put the key file. If used with the user
attribute, this will take precedence over the path to a user's home direcotry, but the file will be created (if necessary) as that user.</code></td>
<td><code>/etc/ssh</code></td>
<td>no</td>
</tr>
</tbody>
</table>
Example
ssh_user_private_key 'github_key' do
key get_my_super_secret_key
end
ssh_user_private_key 'testman_server_key' do
key get_my_super_secret_key
user 'testman'
end
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
Copyright (c) 2013 franklin under the MIT license.
Dependent cookbooks
user >= 0.0.0 |
ssh-util >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.1 failed this metric
Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.1 failed this metric
FC064: Ensure issues_url is set in metadata: ssh_user/metadata.rb:1
FC065: Ensure source_url is set in metadata: ssh_user/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ssh_user/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: ssh_user/resources/private_key.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: ssh_user/providers/private_key.rb:17
FC085: Resource using new_resource.updated_by_last_action to converge resource: ssh_user/providers/private_key.rb:26
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.1 passed this metric
Publish Metric
0.1.1 passed this metric
Supported Platforms Metric
0.1.1 passed this metric
Testing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 failed this metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.1 failed this metric
FC064: Ensure issues_url is set in metadata: ssh_user/metadata.rb:1
FC065: Ensure source_url is set in metadata: ssh_user/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ssh_user/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: ssh_user/resources/private_key.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: ssh_user/providers/private_key.rb:17
FC085: Resource using new_resource.updated_by_last_action to converge resource: ssh_user/providers/private_key.rb:26
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.1 passed this metric
Publish Metric
0.1.1 passed this metric
Supported Platforms Metric
0.1.1 passed this metric
Testing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 failed this metric
FC065: Ensure source_url is set in metadata: ssh_user/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ssh_user/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: ssh_user/resources/private_key.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: ssh_user/providers/private_key.rb:17
FC085: Resource using new_resource.updated_by_last_action to converge resource: ssh_user/providers/private_key.rb:26
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.1 passed this metric
Publish Metric
0.1.1 passed this metric
Supported Platforms Metric
0.1.1 passed this metric
Testing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 passed this metric
0.1.1 passed this metric
Testing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 failed this metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number