Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

ssh-private-keys (4) Versions 2.0.1

Deploy OpenSSH private keys

Policyfile
Berkshelf
Knife
cookbook 'ssh-private-keys', '= 2.0.1', :supermarket
cookbook 'ssh-private-keys', '= 2.0.1'
knife supermarket install ssh-private-keys
knife supermarket download ssh-private-keys
README
Dependencies
Quality 33%

ssh-private-keys-cookbook

Chef cookbook to deploy OpenSSH private keys on a system. Data is stored in the encrypted data bag or chef-vault which name is specified in the attribute node['ssh-private-keys']['data_bag_name'] (by default ssh-private-keys). Data bag may have two layouts: simple and andvanced. In simple layout bag item name contains the name of the user which key you're want to deploy. Advanced layout is more complex and should match the node.chef_environment value.

Simple data bag format

{
    "id": "admin1",
    "keys": {
        "id_rsa": ""
     }
}

Advanced data bag format

{
  "id": "development",
  "server1.acme.corp": {
    "admin1": {
      "id_rsa": "",
    }
  },
  "server2.acme.corp": {
    "admin2": {
      "id_ed25519": ""
    }
  }
}

Resources

ssh_private_key

Keys deployment is made by using ssh_private_key resource. For example,

ssh_private_key 'admin1'

Server hostname will be automatically detected and the appropriate record will be retrieved from the encrypted data bag. All keys in the specified record (e.g. RSA, Ed25519) will be placed under user's SSH directory (/home/username/.ssh).

Attributes

You can use attributes to specify the default behavior for ssh_private_key resource.

  • default['ssh-private-keys']['default_source'] - Specify 'databag' or 'chef-vault'
  • default['ssh-private-keys']['data_bag_name'] - Bag name or vault name to load ssh keys from
  • default['ssh-private-keys']['data_bag_layout'] - Specify databag layout type. May be 'simple' or 'advanced'

Properties

You can override default values specified in attributes by defining custom properties on the particular resource.

ssh_private_key resource has the following properties:

  • source - Specify 'databag' or 'chef-vault'
  • bag - Data bag name or vault name to load ssh keys from (default is 'ssh-private-keys')
  • layout - Specify databag layout type. May be 'simple' or 'advanced' (default)

Example resource usage

user "test"
ssh_private_key "test" do
    source 'chef-vault'
    layout 'simple'
end

Testing

Run script/bootstrap to install necessary Ruby Gems.

Run script/test to perform KitchenCI tests.

License

MIT @ Alexander Pyatkin

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

2.0.1 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

2.0.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
            

2.0.1 passed this metric

No Binaries Metric
            

2.0.1 passed this metric

Testing File Metric
            

2.0.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
            

2.0.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