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

chrome (28) Versions 0.4.0

Installs/Configures Chrome browser

Policyfile
Berkshelf
Knife
cookbook 'chrome', '= 0.4.0', :supermarket
cookbook 'chrome', '= 0.4.0'
knife supermarket install chrome
knife supermarket download chrome
README
Dependencies
Changelog
Quality 100%

Chrome Cookbook

Build Status

This cookbook installs Google Chrome browser (https://www.google.com/chrome/) at compile time, provides a library
method to retrieve version installed, and provides a resource to set
default user preferences.

Requirements

Chef 11.14.2 and Ruby 1.9.3 or higher.

Platform

  • Windows Server 2012 R2

Cookbooks

  • windows

Usage

Include the default recipe on a node's runlist to ensure that Chrome is installed.

To get Chrome version installed:

v = chrome_version

Resources

Preferences

Manage a template resource for configuring
master preferences.

Examples

The following example would look for a template named master_preferences.json.erb in your cookbook.

chrome 'custom_preferences' do
  params(
    homepage: 'https://mycompany.com/'
    import_bookmarks_from_file: 'c:\path\to\bookmarks.html'
  )
  action :preferences
end

The Chrome cookbook comes with a master_preferences.json.erb template as an example. The following parameter is used
in the template:

  • homepage - Sets the homepage URL.

To use the default template preferences, set cookbook to chrome, for example:

chrome 'set_user_preferences' do
  cookbook 'chrome'
  params(
    homepage: 'https://www.getchef.com'
  )
  action :preferences
end

The parameter specified will be used as:

  • @params[:homepage]

In the template, when you write your own, the @ is significant.

Resource Attributes

Current attributes used by preferences:

  • name - The name of the preference.
  • cookbook - Optional. Cookbook where the source template is. If this is not defined, Chef will use the named template in the cookbook where the definition is used.
  • template - Default master_preferences.json.erb, source template file.
  • params - Additional parameters, see Examples.

Attributes

  • node['chrome']['src'] - URI to Google Chrome FTW (MSI installer).
  • node['chrome']['master_preferences'] - Path to Chrome master_preferences file.
  • node['chrome']['32bit_only'] - Install only 32-bit browser on 64-bit machines.

ChefSpec Matchers

The Chrome cookbook includes custom ChefSpec matchers you can use to test your
own cookbooks.

Example Matcher Usage

expect(chef_run).to preferences_chrome('name').with(
  params: {
    homepage: 'https://www.getchef.com'
  }
)

Chrome Cookbook Matchers

  • preferences_chrome(name)

Getting Help

Contributing

Please refer to CONTRIBUTING.

License

MIT - see the accompanying LICENSE file for details.

Chrome Changelog

0.4.0

  • Add 64-bit support

0.3.0

  • Add chrome_version method
  • Install Chrome at compile time
  • Warn if not windows platform

0.2.0

  • Add preferences resource

0.1.0

  • Initial release

Foodcritic Metric
            

0.4.0 passed this metric