Giter VIP home page Giter VIP logo

Comments (6)

jamescott avatar jamescott commented on August 26, 2024

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.

jamescott avatar jamescott commented on August 26, 2024

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.

jamescott avatar jamescott commented on August 26, 2024

(note above the 0777 in my first reply is related to the changes for Chef 11.6)

from chef-web-docs-2016.

jamescott avatar jamescott commented on August 26, 2024

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.

jamescott avatar jamescott commented on August 26, 2024

and that (hopefully) answers your initial question about what the default value for mode should be.

from chef-web-docs-2016.

e0da avatar e0da commented on August 26, 2024

EXCELLENT! That all makes sense, and the documentation updates looks great. THANK YOU! 😄

from chef-web-docs-2016.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.