cookbook 'chrome', '= 3.0.0'
chrome
(28) Versions
3.0.0
-
Follow25
Installs/Configures Chrome browser
cookbook 'chrome', '= 3.0.0', :supermarket
knife supermarket install chrome
knife supermarket download chrome
Chrome Cookbook
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
resource
to set user preferences.
Requirements
Chef 12.14+
Platforms
- CentOS 7, Red Hat 7, Fedora
- Debian, Ubuntu
- Mac OS X
- Windows
Cookbooks
- dmg - used by Mac OS X platform
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 isstable
. -
node['chrome']['32bit_only']
- For windows only. Install 32-bit browser on 64-bit machines. Default isfalse
.
See attributes/default.rb for complete list
of attributes.
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
- Defaultmaster_preferences.json.erb
, source template file. -
params
- 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 params( 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' params( homepage: 'https://www.getchef.com' ) action :master_preferences end
The parameter specified will be used as:
@params[: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( params: { homepage: 'https://www.getchef.com' } )
Cookbook Matchers
- master_preferences_chrome(name)
Getting Help
- Ask specific questions on Stack Overflow.
- Report bugs and discuss potential features in Github issues.
Contributing
Please refer to CONTRIBUTING.
License
MIT - see the accompanying LICENSE file for details.
Changelog
3.0.0 2017-01-09
- Require Chef client 12.14 or greater
- Remove apt and yum cookbook dependencies
2.0.1 2017-01-09
- PR #15 Default apt arch to amd64
2.0.0 2016-10-01
- Dropped support for Chef 11
1.2.2 2016-06-03
- PR #11 Use the machine key as opposed to processor
1.2.1 2016-05-13
- Fix #10 OSX 10.9 chrome_version throws exception
1.2.0 2016-05-12
- Constrain apt package to a particular arch
1.1.1 2015-09-27
- Fix #7 Chef::Exceptions::InvalidRemoteFileURI on Windows platform
1.1.0
- Fix FC052: Metadata uses the unimplemented "suggests" keyword
- Update metadata description, source_url and issues_url
1.0.12
- Remove 'Google Chrome' string from chrome_version for mac installations
- Add separate kitchen yaml for mac
- Replace contributors file with link to github
1.0.11
- Remove Chef 12 source_url and issues_url from metadata
1.0.10
- Use correct apt repository name
1.0.9
- Revert fix for apt-get issue with updated Google sign key
1.0.8
- Add apt unit tests
1.0.7
- Fix apt-get issue with updated Google sign key
1.0.6
- Fix windows master preferences path
1.0.5
- Fix mac issues
1.0.4
- Fix rubocop offenses
1.0.3
- Fix readme rendering issue on supermarket
1.0.2
- Rename .chefignore to chefignore
1.0.1
- Fix Chef Client 12 introduced error: undefined method `new' for Chrome:Module
- Remove trailing space from chrome_version
- Add .chefignore
1.0.0
- Support multiple platforms
- Rename preferences resource to master_preferences
0.4.0
- Add 64-bit support for windows
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
Collaborator Number Metric
3.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
3.0.0 passed this metric
Foodcritic Metric
3.0.0 passed this metric
License Metric
3.0.0 passed this metric
No Binaries Metric
3.0.0 passed this metric
Testing File Metric
3.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 http://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 passed this metric
3.0.0 failed this metric
3.0.0 passed this metric
Foodcritic Metric
3.0.0 passed this metric
License Metric
3.0.0 passed this metric
No Binaries Metric
3.0.0 passed this metric
Testing File Metric
3.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 http://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 passed this metric
3.0.0 passed this metric
3.0.0 passed this metric
No Binaries Metric
3.0.0 passed this metric
Testing File Metric
3.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 http://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 passed this metric
3.0.0 passed this metric
3.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 http://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 passed this metric
3.0.0 passed this metric