cookbook 'codenamephp_ssh_keys', '~> 1.0.0'
The codenamephp_ssh_keys cookbook has been deprecated
Author provided reason for deprecation:
The codenamephp_ssh_keys cookbook has been deprecated and is no longer being maintained by its authors. Use of the codenamephp_ssh_keys cookbook is no longer recommended.
codenamephp_ssh_keys (1) Versions 1.0.0 Follow0
Cookbook to install apache2
cookbook 'codenamephp_ssh_keys', '~> 1.0.0', :supermarket
knife supermarket install codenamephp_ssh_keys
knife supermarket download codenamephp_ssh_keys
Chef Cookbook
Usage
Just use this in your wrapper cookbook and use the resources any way you see fit.
Resources
local_copy
The codenamephp_ssh_keys_local_copy
resources copies the key pair from a local path to the user .ssh folder and makes sure it has the correct permissions. The resources makes some assumptions:
- The user the keys will be copied to exists. If the user doesn't exist the resource will error. Use a only_if/not_if guard if necessary.
- The public key is in the same location as the private key and just has the .pub extension
- The private key will be copied to ~/.ssh/ with the same file name
- The public key will aso be copied to ~/.ssh/ and will get the same filename as the private key with the .pub extension
If any of these assumptions differ from what you need make sure to set the appropriate properties.
Actions
-
:installs
: Copies both keys (if they exist) to the user .ssh folder
Properties
-
user
: The user name the keys will belong to -
private_key_source
: The path of the private key file -
private_key_target
: The path where the private key will be copied to, defaults to~/.ssh/original_filename
-
public_key_source
: The path of the public key file, defaults toprivate_key_source.pub
-
public_key_target
: The path where the public key will be copied to, defaults toprivate_key_target.pub
Examples
# Minimal properties codenamephp_ssh_keys_local_copy 'Copy keys' do user 'test' private_key_source '/var/workspace/id_rsa' end # With custom paths codenamephp_ssh_keys_local_copy 'Copy keys' do user 'test' private_key_source '/var/workspace/id_rsa' private_key_target '/home/test/.not-ssh/id_rsa' public_key_source '/var/public/some_key.pub' public_key_target '/tmp/not/sure/why.pub' end
Why?
I like to use VMs as my local workstations I create with Vagrant + Chef. My base workspace folder (containing the chef repo and other common stuff) is mounted to /var/workspace using vagrant. So I use this as a simple way to install the ssh keys without any sophisticated vault solution and still don't have my keys to leave my local system.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
Collaborator Number Metric
1.0.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.0 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
Cookstyle Metric
1.0.0 passed this metric
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.0 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
1.0.0 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
1.0.0 failed this metric
1.0.0 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
Cookstyle Metric
1.0.0 passed this metric
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.0 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
1.0.0 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
1.0.0 passed this metric
1.0.0 passed this metric
Testing File Metric
1.0.0 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
1.0.0 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
1.0.0 failed this metric
1.0.0 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