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

cr_chrome (1) Versions 4.0.2

Installs/Configures Chrome browser

Policyfile
Berkshelf
Knife
cookbook 'cr_chrome', '~> 4.0.2', :supermarket
cookbook 'cr_chrome', '~> 4.0.2'
knife supermarket install cr_chrome
knife supermarket download cr_chrome
README
Dependencies
Quality 17%

This cookbook installs Google Chrome browser (https://www.google.com/chrome/) at compile time, provides
chrome_version library method to retrieve Chrome version installed, and provides master_preferences and chrome_policy resources
to set user preferences and policies.

This project is a part of Cooking Robot group. It's a fork of a great project: https://github.com/dhoer/chef-chrome.

Requirements

Chef 12.14+

Platforms

  • CentOS 7, Red Hat 7, Fedora
  • Debian, Ubuntu
  • Mac OS X
  • Windows

Recipes

  • dmg - used by Mac OS X platform
  • apt - used by Debian familiy
  • msi - used by Windows family
  • yum - used by RedHat Family
  • default - Call another recipe for current OS

Usage

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

A library method chrome_version is provided to retrieve the Chrome version installed:

v = chrome_version

Tip: use allow_any_instance_of to stub chrome_version method when testing with rspec:

allow_any_instance_of(Chef::Recipe).to receive(:chrome_version).and_return('50.0.0.0')

Attributes

  • node['chrome']['track'] - For Linux only. Install stable, beta or unstable version. Default is stable.
  • node['chrome']['32bit_only'] - For windows only. Install 32-bit browser on 64-bit machines. Default is false.

See attributes/default.rb for complete list
of attributes.

chrome_policy

Manage chrome policies for administrators.
More info...

Resource Attributes

  • name - The name of the policy
  • value - Value of the policy

Actions

Action can be :managed or :recommanded. Managed policy is enforced. Recommanded policy is set by default but
the user can change theses policies.

Exemples

The following resource configure the home page. See Chrome documentation.

chrome_policy 'HomepageLocation' do
  value 'https://mycompany.com/'
end

master_preferences

Manage a template resource that configures master_preferences.
More info...

Resource Attributes

  • 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.
  • parameters - Additional parameters, see Examples.

Examples

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

chrome 'custom_preferences' do
  parameters(
    homepage: 'https://mycompany.com/'
    import_bookmarks_from_file: 'c:\path\to\bookmarks.html'
  )
  action :master_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'
  parameters(
    homepage: 'https://www.getchef.com'
  )
  action :master_preferences
end

The parameter specified will be used as:

  • @parameters[:homepage]

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

ChefSpec Matchers

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

Example Matcher Usage

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

Cookbook Matchers

  • master_preferences_chrome(name)

Dependent cookbooks

dmg >= 3.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

4.0.2 failed this metric

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

Contributing File Metric
            

4.0.2 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
            

4.0.2 failed this metric

Chef/Deprecations/FoodcriticTesting: The Foodcritic cookbook linter has been deprecated and should no longer be used for validating cookbooks. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_foodcritictesting): cr_chrome/Gemfile: 7
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): cr_chrome/resources/chrome_policy.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): cr_chrome/resources/master_preferences.rb: 1
Chef/Deprecations/UseInlineResourcesDefined: use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_useinlineresourcesdefined): cr_chrome/providers/master_preferences.rb: 5
Chef/Modernize/DefinesChefSpecMatchers: ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook (https://docs.chef.io/workstation/cookstyle/chef_modernize_defineschefspecmatchers): cr_chrome/libraries/matchers.rb: 1
Chef/Modernize/UnnecessaryDependsChef14: Don't depend on cookbooks made obsolete by Chef Infra Client 14.0+. These community cookbooks contain resources that are now included in Chef Infra Client itself. (https://docs.chef.io/workstation/cookstyle/chef_modernize_unnecessarydependschef14): cr_chrome/metadata.rb: 21
Chef/Modernize/WhyRunSupportedTrue: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue): cr_chrome/providers/master_preferences.rb: 1
Chef/RedundantCode/LongDescriptionMetadata: The long_description metadata.rb method is not used and is unnecessary in cookbooks. (https://docs.chef.io/workstation/cookstyle/chef_redundantcode_longdescriptionmetadata): cr_chrome/metadata.rb: 6
Chef/RedundantCode/UnnecessaryNameProperty: There is no need to define a property or attribute named :name in a resource as Chef Infra defines this on all resources by default. (https://docs.chef.io/workstation/cookstyle/chef_redundantcode_unnecessarynameproperty): cr_chrome/resources/chrome_policy.rb: 4
Chef/RedundantCode/UnnecessaryNameProperty: There is no need to define a property or attribute named :name in a resource as Chef Infra defines this on all resources by default. (https://docs.chef.io/workstation/cookstyle/chef_redundantcode_unnecessarynameproperty): cr_chrome/resources/master_preferences.rb: 4

Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations

No Binaries Metric
            

4.0.2 passed this metric

Testing File Metric
            

4.0.2 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
            

4.0.2 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