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

blp-grub (3) Versions 1.1.0

Configures grub

Policyfile
Berkshelf
Knife
cookbook 'blp-grub', '~> 1.1.0', :supermarket
cookbook 'blp-grub', '~> 1.1.0'
knife supermarket install blp-grub
knife supermarket download blp-grub
README
Dependencies
Changelog
Quality 50%

blp-grub cookbook

Build Status
Cookbook Version
License

Cookbook which configures the Grub Bootloader.

Platforms

The following platforms are tested automatically
using Test Kitchen, in Docker, with
the default suite of integration tests:

  • Ubuntu 12.04/14.04/16.04
  • CentOS (RHEL) 6/7

Basic Usage

The [default recipe](recipes/default.rb) gives you the ability to pass
attributes to tune your grub settings. There are currently no
defaults in this cookbook so your regular distrobution provided grub
file will remain intact. You can tweak the settings in the
Policefile.rb or directly using attributes. All GRUB specific settings
should use underscores like the examples below.

Hash merging

Values provided as hashes (under ['grub']['config']['settings'][key])
will be merged/flattened to form strings.
This is intended to allow overrides to, for example, kernel boot options without ugly string manipulation.

This approach is probably best demonstrated using an example:

default['grub']['config']['settings']['cmdline_linux']['biosdevname'] = '0'
default['grub']['config']['settings']['cmdline_linux']['nomodeset'] = nil
default['grub']['config']['settings']['cmdline_linux']['console'] = [ 'tty0', 'ttyS1,115200n8']

is the precise equivalent of
ruby
default['grub']['config']['settings']['cmdline_linux'] = 'biosdevname=0 nomodeset console=tty0 console=ttyS1,115200n8'

Using hashes permits simple overrides like the following
ruby
node.override[grub']['config']['settings']['cmdline_linux']['biosdevname'] = '1'

How hash values are merged

for each key = value pair in the hash:

  • if value is nil, it is omitted and the key is inserted without a value
    ...[cmdline_linux']['nomodeset'] = nil results in nomodeset

  • if value is an array, the result is key=v1 key=v2... for each value in the array
    ...['cmdline_linux']['console'] = [ 'x', 'y''] results in console=x console=y

  • otherwise we simply insert key=value
    ...['cmdline_linux']['biosdevname'] = '0' results in biosdevname=0

To permit overrides to (for example) commandline options it is possible to specify

Recipe

node.default['grub']['config']['settings']['timeout'] = 30
node.default['grub']['config']['settings']['distributor'] = "$(sed 's, release .*$,,g' /etc/system-release)"
node.default['grub']['config']['settings']['terminal_output'] = "console"

Policyfile

name 'grub'
default_source :community
run_list 'blp-grub::default'

override['grub']['config']['settings']['timeout'] = 30
override['grub']['config']['settings']['distributor'] = "$(sed 's, release .*$,,g' /etc/system-release)"
override['grub']['config']['settings']['terminal_output'] = "console"

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Change Log

All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.

[1.1.0]

  • Add support for hashes in grub settings

[1.0.1]

  • fix quoting for strings with spaces vs non spaced values

1.0.0

  • Rename and move cookbook under bloomberg-cookbooks organization.
  • Update cookbook to use Chef 12 resource DSL.
  • Updates integration tests to use InSpec and Policyfiles.

Collaborator Number Metric
            

1.1.0 passed this metric

Contributing File Metric
            

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

Foodcritic Metric
            

1.1.0 passed this metric

No Binaries Metric
            

1.1.0 passed this metric

Testing File Metric
            

1.1.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.1.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