Comments (10)
You can follow along at chef/chef#9885 for the root cause, but the tl;dr is that Chef would silently determine what resource it should be loading, but when that went away it defaulted to using the Windows resource. As such, the reason why you saw nothing on Linux and MacOS was that the Windows resource was sanely returning since it wasn't running on WIndows :)
I think by simply renaming the resource to cpe_chrome_win
the collision is gone, it's correctly determining the resource through provides
, and this issue should be solved! Please let me know if you're still having problems and we can look into it, otherwise closing this out.
Thank you so much for bringing this to our attention, helping us get rid of this issue in a few other places too!
from it-cpe.
from it-cpe.
from it-cpe.
Chef 16.0.287 (and Chef 16.1.0), current head of this repo (5e0bce5), Windows 10. The cpe_chrome cookbook doesn't appear to have any issues for me.
Having a better example of a reproduction would be helpful.
PS C:\Users\btm\Documents\IT-CPE\itchef> cat .\chrome.json
{
"cpe_chrome": {
"mp": {
"FileContents": {
"first_run_tabs": [
"https://www.facebook.com"
]
}
}
}
}
PS C:\Users\btm\Documents\IT-CPE\itchef> chef-client -z -o cpe_chrome -j chrome.json
[2020-05-19T20:21:52+00:00] WARN: No config file found or specified on command line. Using command line options instead.
Starting Chef Infra Client, version 16.0.287
[2020-05-19T20:22:06+00:00] WARN: Run List override has been provided.
[2020-05-19T20:22:06+00:00] WARN: Overridden Run List: [recipe[cpe_chrome]]
resolving cookbooks for run list: ["cpe_chrome"]
Synchronizing Cookbooks:
- cpe_profiles (0.1.0)
- cpe_chrome (0.1.0)
- cpe_helpers (0.1.0)
- fb_helpers (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: cpe_chrome::default
* cpe_chrome[Configure Google Chrome] action config[2020-05-19T20:22:07+00:00] WARN: TotalMemoryLimitMb is not a supported setting
* registry_key[HKLM\Software\Policies\Google\Chrome\AutoplayWhitelist] action delete_key (up to date)
* registry_key[HKLM\Software\Policies\Google\Chrome\AutoplayWhitelist] action create (skipped due to not_if)
* registry_key[HKLM\Software\Policies\Google\Chrome\ExtensionInstallForcelist] action delete_key (up to date)
* registry_key[HKLM\Software\Policies\Google\Chrome\ExtensionInstallForcelist] action create (skipped due to not_if)
* registry_key[HKLM\Software\Policies\Google\Chrome\ExtensionInstallBlacklist] action delete_key (up to date)
* registry_key[HKLM\Software\Policies\Google\Chrome\ExtensionInstallBlacklist] action create (skipped due to not_if)
* registry_key[HKLM\Software\Policies\Google\Chrome\DefaultPluginsSetting] action delete_key
- delete key HKLM\Software\Policies\Google\Chrome\DefaultPluginsSetting
* registry_key[HKLM\Software\Policies\Google\Chrome\DefaultPluginsSetting] action create
- create key HKLM\Software\Policies\Google\Chrome\DefaultPluginsSetting
- set value {:name=>"DefaultPluginsSetting", :type=>:dword, :data=>nil}
* registry_key[HKLM\Software\Policies\Google\Chrome\ExtensionInstallSources] action delete_key (up to date)
* registry_key[HKLM\Software\Policies\Google\Chrome\ExtensionInstallSources] action create (skipped due to not_if)
* registry_key[HKLM\Software\Policies\Google\Chrome\PluginsAllowedForUrls] action delete_key (up to date)
* registry_key[HKLM\Software\Policies\Google\Chrome\PluginsAllowedForUrls] action create (skipped due to not_if)
* registry_key[HKLM\Software\Policies\Google\Chrome\RelaunchNotification] action delete_key
- delete key HKLM\Software\Policies\Google\Chrome\RelaunchNotification
* registry_key[HKLM\Software\Policies\Google\Chrome\RelaunchNotification] action create
- create key HKLM\Software\Policies\Google\Chrome\RelaunchNotification
- set value {:name=>"RelaunchNotification", :type=>:dword, :data=>nil}
* registry_key[HKLM\Software\Policies\Google\Chrome\RelaunchNotificationPeriod] action delete_key
- delete key HKLM\Software\Policies\Google\Chrome\RelaunchNotificationPeriod
* registry_key[HKLM\Software\Policies\Google\Chrome\RelaunchNotificationPeriod] action create
- create key HKLM\Software\Policies\Google\Chrome\RelaunchNotificationPeriod
- set value {:name=>"RelaunchNotificationPeriod", :type=>:dword, :data=>nil}
* file[delete-c:\Program Files (x86)\Google\Chrome\Application\master_preferences] action delete (skipped due to only_if)
* directory[C:\Program Files (x86)\Google] action create (up to date)
* directory[C:\Program Files (x86)\Google\Chrome] action create (up to date)
* directory[C:\Program Files (x86)\Google\Chrome\Application] action create (up to date)
* file[create-c:\Program Files (x86)\Google\Chrome\Application\master_preferences] action create (up to date)
[2020-05-19T20:22:07+00:00] WARN: Skipping final node save because override_runlist was given
Running handlers:
Running handlers complete
Chef Infra Client finished, 7/22 resources updated in 09 seconds
from it-cpe.
Sweet, I'll backport this fix as well. Glad you were able to replicate it.
from it-cpe.
@steelcowboy as I mentioned over on this commit, I recommend leaving the resources with the same name, but the linux version needs a provides
line added to it.
This makes it easier on the user, you don't have to figure out and remember if it is cpe_chrome_win or cpe_chrome_linux or cpe_chrome or win_cpe_chrome or any other combination. You can have multiple resources with the same name (even on Chef 16) but chef needs the provides line to figure out which one to use.
from it-cpe.
from it-cpe.
@steelcowboy as I mentioned over on this commit, I recommend leaving the resources with the same name, but the linux version needs a
provides
line added to it.
@btm what directory structure would you recommend, if the resources have the same names?
Currently we have
cpe_chrome
|- resources
|- cpe_chrome_posix.rb (renamed from cpe_chrome.rb)
|- cpe_chrome_win.rb
with both resources providing cpe_chrome
for the proper OSes.
curious what your recommendation is. This works, and it's the Facebook convention so people who use Chef won't get confused, so if there's a more canonical way we should consider doing a full refactor to be consistent.
from it-cpe.
@michel-slm that is fine, but would drop the resource_name
lines from the resources.
lamont: if you haven’t set a resource_name yet, chef 16 will wire up a resource_name for the first provides it finds
lamont: (there’s also the fallback default of cookbook_name+resource_file if nothing at all is found)
when you have both a resource_name
and provides
you're kind of telling chef what the resource is called twice.
from it-cpe.
@btm oh interesting. Is that safe on all Chef versions? On the production side Facebook is still using Chef 13 (and trying to upgrade); on the client side we're on 15/16 but we want to keep our style guide consistent.
from it-cpe.
Related Issues (20)
- cpe_remote claims some URLs are invalid HOT 2
- cpe_remote should be able to force install expired packages HOT 3
- Undefined method error when trying to define ManagedBookmarks via cpe_chrome on Windows HOT 5
- cpe_chrome fails on Windows in exciting ways HOT 5
- cpe_nomad is still using fb_launchd HOT 3
- where is quickstart.json? HOT 1
- Create a migration path from the old chef code to the new chef code HOT 2
- Chef 16.2 breaking changes and consistency in cookbooks HOT 8
- cpe_remote ruby warning in Chef 16.2.73 HOT 2
- add ChoiceChanges.xml support for cpe_remote_pkg HOT 2
- Change return on cpe_munki_locals Resource HOT 4
- Enablement of `unified_mode` for v17+ Chef client compatibility
- cpe_chrome does not require dependency on fb_osquery HOT 5
- `rescue StandardError` in fb_helpers HOT 1
- Native Chef Helpers functions duplicated as node methods HOT 5
- Sevenzip artifact HOT 1
- Curtail usage of Windows 'Administrators', favor SID instead HOT 3
- quickstart.json fails due to missing cpe_adobe_flash
- quickstart in readme does not work.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from it-cpe.