This repository has been archived by the owner on Jan 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Correct README.md - Relocate library specs to spec/unit/libraries so foodcritic doesn't catch it - Update metadata.rb to 4.1.0 - Update CHANGELOG.md - Add chefignore (matches current generator in chef generate cookbook) - Update .gitignore to match current generator in chef generate cookbook - Normalize Berksfile
- Loading branch information
Charles Johnson
committed
Jun 11, 2015
1 parent
b33c3f5
commit 0921176
Showing
7 changed files
with
135 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ Berksfile.lock | |
\#*# | ||
.*.sw[a-z] | ||
*.un~ | ||
/cookbooks | ||
|
||
# Bundler | ||
Gemfile.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
source 'https://supermarket.chef.io' | ||
|
||
metadata | ||
|
||
group :integration do | ||
cookbook 'test', :path => 'test/fixtures/cookbooks/test' | ||
cookbook 'postfix' | ||
end | ||
|
||
metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ This cookbook provides tools for working with the Ruby OpenSSL library. It inclu | |
Requirements | ||
------------ | ||
|
||
The `secure_password` method works on any platform with OpenSSL Ruby bindings installed. These bindings are already included with Chef. | ||
The `random_password` mixin works on any platform with the Ruby SecureRandom module. This module are already included with Chef. | ||
|
||
The `openssl_x509` lwrp works on any platform with the OpenSSL Ruby bindings installed. These bindings are already included with Chef. | ||
|
||
|
@@ -63,17 +63,36 @@ When executed, this recipe will ensure that openssl is upgraded to the latest ve | |
Libraries & LWRPs | ||
----------------- | ||
|
||
### secure_password | ||
There are two mixins packaged with this cookbook. | ||
|
||
Most often this method will be used to generate a secure password for use in a variable or an attribute. For example, in a recipe: | ||
### random_password (`OpenSSLCookbook::RandomPassword`) | ||
|
||
The `RandomPassword` mixin can be used to generate secure random passwords in Chef cookbooks, usually for assignment to a variable or an attribute. `random_password` uses Ruby's SecureRandom library and is customizable. | ||
|
||
#### Example Usage | ||
```ruby | ||
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) | ||
node.set_unless[:my_password] = secure_password | ||
Chef::Recipe.send(:include, OpenSSLCookbook::RandomPassword) | ||
node.set['my_secure_attribute'] = random_password | ||
node.set_unless['my_secure_attribute'] = random_password | ||
node.set['my_secure_attribute'] = random_password(length: 50) | ||
node.set['my_secure_attribute'] = random_password(length: 50, mode: :base64) | ||
node.set['my_secure_attribute'] = random_password(length: 50, mode: :base64, encoding: 'ASCII') | ||
``` | ||
|
||
Note that node attributes are widely accessible. Storing unencrypted passwords in node attributes, as in this example, carries risk. | ||
|
||
### ~~secure_password (`Opscode::OpenSSL::Password`)~~ | ||
|
||
This library should be considered deprecated and will be removed in a future version. Please use `OpenSSLCookbook::RandomPassword` instead. The documentation is kept here for historical reasons. | ||
|
||
#### ~~Example Usage~~ | ||
```ruby | ||
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) | ||
node.set_unless['my_password'] = secure_password | ||
``` | ||
|
||
~~Note that node attributes are widely accessible. Storing unencrypted passwords in node attributes, as in this example, carries risk.~~ | ||
|
||
### openssl_x509 | ||
|
||
This LWRP generates self-signed, PEM-formatted x509 certificates. If no existing key is specified, the LWRP will automatically generate a passwordless key with the certificate. | ||
|
@@ -91,7 +110,7 @@ This LWRP generates self-signed, PEM-formatted x509 certificates. If no existing | |
| `key_length` | Fixnum (Optional) | The desired Bit Length of the generated key. _Default: 2048_ | | ||
| `owner` | String (optional) | The owner of all files created by the LWRP. _Default: "root"_ | | ||
| `group` | String (optional) | The group of all files created by the LWRP. _Default: "root"_ | | ||
| `mode` | The permission mode of all files created by the LWRP. _Default: "0400"_ | | ||
| `mode` | String or Fixnum (Optional) | The permission mode of all files created by the LWRP. _Default: "0400"_ | | ||
|
||
#### Example Usage | ||
|
||
|
@@ -111,14 +130,12 @@ License and Author | |
------------------ | ||
|
||
Author:: Jesse Nelson (<[email protected]>) | ||
Author:: Seth Vargo (<[email protected]>) | ||
Author:: Charles Johnson (<[email protected]>) | ||
Author:: Joshua Timberman (<[email protected]>) | ||
|
||
======= | ||
|
||
|
||
|
||
|
||
```text | ||
Copyright:: 2009-2015, Chef Software, Inc <[email protected]> | ||
|
@@ -134,4 +151,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Put files/directories that should be ignored in this file when uploading | ||
# or sharing to the community site. | ||
# Lines that start with '# ' are comments. | ||
|
||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
Icon? | ||
nohup.out | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# SASS # | ||
######## | ||
.sass-cache | ||
|
||
# EDITORS # | ||
########### | ||
\#* | ||
.#* | ||
*~ | ||
*.sw[a-z] | ||
*.bak | ||
REVISION | ||
TAGS* | ||
tmtags | ||
*_flymake.* | ||
*_flymake | ||
*.tmproj | ||
.project | ||
.settings | ||
mkmf.log | ||
|
||
## COMPILED ## | ||
############## | ||
a.out | ||
*.o | ||
*.pyc | ||
*.so | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*/rdoc/ | ||
|
||
# Testing # | ||
########### | ||
.watchr | ||
.rspec | ||
spec/* | ||
spec/fixtures/* | ||
test/* | ||
features/* | ||
Guardfile | ||
Procfile | ||
|
||
# SCM # | ||
####### | ||
.git | ||
*/.git | ||
.gitignore | ||
.gitmodules | ||
.gitconfig | ||
.gitattributes | ||
.svn | ||
*/.bzr/* | ||
*/.hg/* | ||
*/.svn/* | ||
|
||
# Berkshelf # | ||
############# | ||
Berksfile | ||
Berksfile.lock | ||
cookbooks/* | ||
tmp | ||
|
||
# Cookbooks # | ||
############# | ||
CONTRIBUTING | ||
|
||
# Strainer # | ||
############ | ||
Colanderfile | ||
Strainerfile | ||
.colander | ||
.strainer | ||
|
||
# Vagrant # | ||
########### | ||
.vagrant | ||
Vagrantfile | ||
|
||
# Travis # | ||
########## | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
spec/libraries/random_password_spec.rb → spec/unit/libraries/random_password_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters