Comments (6)
Mode is an attribute of the directory resource: http://docs.opscode.com/resource_directory.html#attributes
If the file already exists, Chef will use the same mode value. If the file does not exist, Chef will pass a 0777, and then subtract the umask on the system to get the final value.
So there isn't really a specific "default" value.
from chef-web-docs-2016.
I updated the mode description to include a better description of what Chef does when mode isn't specified. Also here:
"The octal mode for a file. If mode
is not specified and if the directory already exists, the existing mode on the directory is used. If mode
is not specified, the directory does not exist, and the :create
action is specified, the directory will be created according to the umask of the node on which the directory is to be created. For example, the default mode is often 0644
when the umask on the node is 022
(a common default value for the root user on many |unix| systems)."
Also, this behavior is going to change (slightly) with the impending release of Chef 11.6. The release notes will contain a short section on this change.
Hope this helps!
James
from chef-web-docs-2016.
(note above the 0777 in my first reply is related to the changes for Chef 11.6)
from chef-web-docs-2016.
OK, after some more discussion here, updated description for mode attribute. For the directory resource:
http://docs.opscode.com/resource_directory.html#attributes
and then for the File-based resources:
http://docs.opscode.com/resource_file.html#attributes
(which is the same for cookbook_file, file, remote_file, and template resources)
and then the release notes for 11.6 describe what will change:
http://docs.opscode.com/release_notes.html#updated-behavior-for-mode-attribute
from chef-web-docs-2016.
and that (hopefully) answers your initial question about what the default value for mode should be.
from chef-web-docs-2016.
EXCELLENT! That all makes sense, and the documentation updates looks great. THANK YOU! 😄
from chef-web-docs-2016.
Related Issues (20)
- Compliance api update HOT 3
- chef_gem examples are outdated HOT 2
- docs.chef.io missing error_messages page for external-postgresql HOT 1
- chef_gem 'compile_time' wording isn't so great HOT 2
- remove-partitions option to opscode-reporting-ctl should be documented HOT 1
- document block argument to load_current_value HOT 12
- Open source to chef server 12 link is missing from upgrade cods HOT 1
- Manually loading encrypted databags is missing from the docs
- chef generate cookbook sentence is Deep.
- Greatly expand uninstall procedure
- metadata.rb doc is wrong for 'ohai_version' HOT 1
- Docs misrepresent default behaviour of chef-client -l
- Installation of Supermarket does not seem to be documented HOT 2
- Error in : chef-web-docs-2016/includes_delivery_integration/includes_delivery_integration_ldap_attributes.rst
- General compliance.rb improvements HOT 3
- (low pri) compliance api documentation bug HOT 1
- (windows) kitchen.yml docs
- Document new Ohai ohai flags
- `chef provision` docs don't show how to include dependencies in './provision/metadata.rb'
- Chef Server /universe example return values are incorrect/misleading
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 chef-web-docs-2016.