Git Product home page Git Product logo

chef-web-docs's Introduction

Chef documentation

This GitHub repository is the source for the Chef documentation published on docs.chef.io.

The chef/chef-web-docs repository contains:

  • Source code for the Chef documentation theme
  • Markdown files for much of the Chef Infra Client content
  • Configuration files
  • Vendored documentation from other repositories that are presented on docs.chef.io.

Style guide

See the Chef Documentation Style Guide for style guidance. If you don't find style guidance in the Chef Documentation Style Guide, use Google's Style Guide or Microsoft's Style Guide.

Distributed documentation

The Chef documentation source is highly distributed and depends on Hugo modules to pull in documentation from other Chef repositories. The content from those repositories is vendored in chef-web-docs.

To make changes to the content in those repositories, submit pull requests to the appropriate repository. don't submit pull requests to the vendored files in chef-web-docs. We will update those changes after they're merged or after a new version of a product is released.

GitHub repositories

We source documentation from the following repositories:

We source the theme from this site from https://github.com/chef/chef-docs-theme.

DCO signoff

The fastest way to change the documentation is to edit a page on the GitHub website using the GitHub UI.

To perform edits using the GitHub UI, click on the [edit on GitHub] link at the top of the page that you want to edit. The link takes you to that topic's GitHub page. In GitHub, click on the pencil icon and make your changes. You can preview how they'll look right on the page ("Preview Changes" tab).

We also require contributors to include their DCO signoff in the comment section of every pull request, except for obvious fixes. You can add your DCO signoff to the comments by including Signed-off-by:, followed by your name and email address, like this:

Signed-off-by: Haris Shefu <[email protected]>

See our blog post for more information about the DCO and why we require it.

After you've added your DCO signoff, add a comment about your proposed change, then click on the "Propose file change" button at the bottom of the page and confirm your pull request. The CI system will do some checks and add a comment to your PR with the results.

The Chef Documentation Team can normally merge pull requests within seven days. We'll fix build errors before we merge, so you don't have to worry about passing all of the CI checks, but it might add an extra few days. The important part is submitting your change.

Edit on GitHub links

We use a partial edit_on_github.html to add "Edit on GitHub" links to each page.

Each page should have a gh_repo parameter set to the value of the GitHub repository that the page comes from. For example, gh_repo = "chef-server"

Each repository with documentation has a config.toml file with a params.<REPOSITORY> map and a gh_path parameter set to the path of the docs content directory in that repository.

The edit_on_github partial appends the page file name to the end of gh_path parameter and adds the link to the text of the page.

Local development environment

The Chef Documentation website is built using:

  • Hugo 0.123.4 or higher
  • Node 20.0.0 or higher
  • NPM 10.4.0 or higher
  • Go 1.22 or higher

To install Hugo, NPM, and Go on Windows, run:

choco install hugo-extended nodejs golang sass

To install Hugo, NPM, Go, and Dart Sass on macOS, run:

brew install hugo node go sass/sass/sass

To install Hugo on Ubuntu, run:

  • apt install -y build-essential
  • snap install node --classic --channel=12
  • snap install hugo --channel=extended
  • snap install dart-sass

Troubleshoot your development environment

To clean your local development environment:

  • Run make clean_all to delete the SASS files, Javascript, and fonts. Hugo rebuilds these the next time you run make serve.

  • Run make clean_all to delete the node modules used to build this site in addition to the functions of make clean described above. Those node modules will be reinstalled the next time you run make serve.

Site theme

The theme for this site is deployed from the chef/chef-docs-theme repository.

Node modules

The Node modules defined in the package.json file are sourced from the package.hugo.json file in the chef/chef-docs-theme repository. To update these Node dependencies, update them in chef/chef-docs-theme, then update the theme and the package.json file in this repository.

Local theme testing

You can test local changes made to the chef-docs-theme repository and preview those changes using Hugo's local development server. To do this, create a Go workspace file that modifies the source of Hugo's modules, source the workspace file, and start the local server.

For example:

  1. Create a hugo.work file in root of this project.

  2. Add the following config information to the hugo.work file:

    go 1.22
    
    use .
    use ../path/to/local/chef-docs-theme
  3. Start the Hugo local server:

    make test_theme

    This command adds the hugo.work file to the Hugo workspace and then ignores the contents of chef-docs-theme repo in the _vendor directory.

Test theme branch

You can target a Git commit, branch, or tag when importing a module. This allows you to push a test branch up to chef/chef-docs-theme and then import it into this repository for local testing.

For example:

hugo mod get -u github.com/chef/chef-docs-theme@<GIT_COMMIT_SHA>

or

hugo mod get -u github.com/chef/chef-docs-theme@<GIT_BRANCH>

Update theme

Run make update_theme to update the chef-docs-theme to the latest commit. This updates the theme and the theme's node dependencies.

Build and preview the docs

You can preview documentation using one of the following:

  • Submit a PR and look at the Netlify preview.
  • Build the documentation locally.

Submit a PR and look at the Netlify preview

Netlify generates deploy previews of pull requests made on the chef-web-docs repository and adds a link to the pull request page. This is automatic for members of the Chef GitHub organization; the Documentation Team can manually trigger Netlify to build previews from contributors who aren't members of the Chef GitHub organization.

Build and preview the docs locally

Build and preview using Netlify CLI

You can use the Netlify CLI to build and preview documentation locally. This is useful for previewing redirects configured in the netlify.toml file.

Requirements:

  • all the requirements for building this site locally
  • Netlify CLI

Run netlify dev to preview the site using the Netlify CLI.

Build and preview the docs from the source repositories

  • Run make serve_ignore_vendor

Some Chef documentation is stored in private repositories so this option is only available to Progress Chef employees.

Hugo vendoring

Vendoring stores all of the module content from other repositories in the _vendor directory at the commit specified by the go.mod file. When Hugo builds the documentation, it will grab content from the _vendor directory instead of the original repository OR a local copy of a that repository. To see which commits the vendored files reference, see the _vendor/modules.txt file.

To vendor the modules in chef-web-docs, run hugo mod vendor.

To update the vendored modules, first update the Hugo module(s), then run hugo mod vendor.

To ignore the vendored files in a Hugo build, run make serve_ignore_vendor. This is the same as make serve except it adds the --ignoreVendor flag. This will build the documentation from the GitHub repositories or from a local copy of a repository if the go.mod file specifies pulling content from a local repository. (see above)

Update Hugo modules

Hugo modules are pinned to a particular commit of the master branch in their repository. If you look in the go.mod and go.sum files, you'll notice that each repository specifies a git commit timestamp and SHA.

To update a particular repo, run:

hugo mod get github.com/chef/repo_to_update/subdirectory
hugo mod clean

Then vendor the documentation:

hugo mod vendor

For example, to update the chef-workstation repository:

hugo mod get github.com/chef/chef-workstation/docs-chef-io
hugo mod clean
hugo mod vendor

This will update that repository to the most recent commit.

You can also update a module to a commit version number. For example:

hugo mod get github.com/chef/chef-workstation/[email protected]
hugo mod clean
hugo mod vendor

And you can update a module to a Git commit. For example:

hugo mod get github.com/chef/chef-workstation/docs-chef-io@0ad84dd5fa8
hugo mod clean
hugo mod vendor

The hugo mod clean command removes references to commits in the go.mod and go.sum files that are no longer relevant.

See Hugo's documentation for additional information about updating Hugo Modules.

Update chef-docs-theme module

The theme for this site is sourced from chef/chef-docs-theme.

Run make update_theme to update the theme module and Node package dependencies.

What if Hugo doesn't update a module

Sometimes Hugo and Git are a bit difficult and won't update a module cleanly or will leave references to older commits of a module in the go.sum file.

If you get an error indicating that Git can't find a repository that's already added as a module, try restarting your computer.

If you still having trouble, try rebuilding the go.mod and go.sum files:

  1. Delete the go.mod and go.sum files.
  2. Re-initialize the Hugo modules, hugo mod init github.com/chef/chef-web-docs This will generate a new, blank go.mod file.
  3. Update the references to the other GitHub repositories, hugo mod get -u.
  4. The previous step will update all modules to the latest commit of their source repositories. If you don't want that, look at the git history of those files and manually edit the go.mod and go.sum files to keep the older commits for the modules that you don't want to update.
  5. Run hugo mod tidy. This probably won't do anything on newly initialized go.mod and go.sum files, but it can't hurt either.
  6. Vendor the modules in chef-web-docs, hugo mod vendor.

Release notes

Release notes are added to release notes pages using Hugo's resource.getRemote function and content from https://omnitruck.chef and https://packages.chef.io.

Chef Automate release versions, release dates, and links to release note Markdown files come from https://packages.chef.io/releases/current/automate.json.

Release versions for Chef Habitat come from https://api.github.com/repos/habitat-sh/habitat/releases.

Release versions for Chef InSpec Cloud resources comes from _vendor/github.com/inspec/inspec-<PLATFORM>/docs-chef-io/assets/release-notes/inspec-<PLATFORM>/release-dates.json.

Release versions for all other Chef products come from https://omnitruck.chef.io/stable/<PRODUCT>/versions/all.

Each release note page comes from a Markdown file from https://packages.chef.io/release-notes/<PRODUCT>/<VERSION>.md.

If a release note Markdown file isn't returned from packages.chef.io, the release note for that version will show the text, "This release doesn't have any release notes."

Preview release notes locally

Release note pages are only generated in the production environment. Running make serve won't build any of the content in the release note pages.

Run make production to build and preview the release notes.

Run make clean_all to purge locally cached release note files.

Add release note pages

To add a release notes page to chef-web-docs, add the following to a Markdown page:

release_notes = "<CHEF_PRODUCT>"
product = "<CHEF_PRODUCT>"
layout = "release_notes"
toc_layout = "release_notes_toc"

The <CHEF_PRODUCT> value comes from the Product Key in the Product Matrix.

Any content included in the release notes Markdown file will be included at the top of the page and the release notes will be appended below.

Archive of pre-2016 commit history

The commit history of this repo before February 12, 2016 has been archived to the chef-web-docs-2016 repo to save space. No changes to the archive repo will be merged; it's just for historical purposes.

Send feedback

We love getting feedback. You can use:

chef-web-docs's People

Contributors

adamleff avatar alexpop avatar btm avatar chef-ci avatar chef-delivery avatar chef-expeditor[bot] avatar cwebberops avatar damacus avatar dependabot[bot] avatar dishanktiwari2501 avatar dkumaras avatar ianmadd avatar jamescott avatar jeremiahsnapp avatar jmassardo avatar lamont-granquist avatar markan avatar markgibbons avatar mjingle avatar nellshamrell avatar phiggins avatar robbkidd avatar ryancragun avatar schisamo avatar scotthain avatar sean-horn avatar stevendanna avatar tas50 avatar tduffield avatar tyler-ball avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-web-docs's Issues

Fully document installation of supermarket

Issue:
1 - Installation should not exclusively rely on community cookbook(s), custom data_bag, etc.. and it should not be a 'black box'.
2 - a user interested in understanding the Supermarket setup process is tasked with reverse engineering a community cookbook to understand what's happening.

Expectation:
Supermarket installation should be fully documented, and any user should be able to setup Supermarket by hand (in a similar fashion to chef-server, analytics, etc..). A link to community resource which aids in the task can be provided as a secondary route for installation.

Reference:
https://docs.chef.io/install_supermarket.html

Document an easy way to get current number of consumed nodes.

The functionality is out there, but it doesnt seem to be documented.
Not sure on the place place, perhaps start with here:
https://docs.chef.io/chef_license.html
and
https://docs.chef.io/api_chef_server.html

knife raw license -s https://localhost/ -c /etc/opscode/pivotal.rb
# knife raw license -s https://localhost/ -c /etc/opscode/pivotal.rb
{
  "limit_exceeded": true,
  "node_license": 25,
  "node_count": 28124,
  "upgrade_url": "http://www.getchef.com/contact/on-premises-simple"
}

(ChefDK) Policyfile doc redundancy

While the About Policyfile page at https://docs.chef.io/policy.html seems to cover the latest implementation, the Policyfile.rb page at https://docs.chef.io/config_rb_policyfile.html is currently rather incomplete and thus misleading (unfortunately the first result in https://docs.chef.io/search.html?q=Policyfile).

Would be helpful to add a link to the "About Policyfile" doc page at the recently updated https://github.com/chef/chef-dk/blob/master/POLICYFILE_README.md since this is still the main "landing page" (https://www.google.de/search?q=chefdk%20policyfile)

(suggestion) Add link to rfc21 to supported platforms to system requirements

Link to be added (or duplicated):
https://github.com/chef/chef-rfc/blob/master/rfc021-platform-support-policy.md

Page in question:
https://docs.chef.io/chef_system_requirements.html

Reason:
that RFC is the best authoritative source of supported platforms, however it's not referenced anywhere in our official docs, which leads customers to infer supported platforms from the download page, or other non-authoritative sources.

Chef Server API docs show the use of the removed private_key parameter

The Chef Server API docs page shows the use of the private_key parameter in the /clients/NAME and /users/NAME PUT endpoints. The use of the private_key parameter has been removed and will throw a HTTP 400 error when used.

https://docs.chef.io/api_chef_server.html

From the Release Notes:

Including any of public_key, private_key, or create_key in PUT requests to 
client/users will cause a 400 response with detailed message.

https://github.com/chef/chef-server/blob/master/PRIOR_RELEASE_NOTES.md#api-changes-and-additions-2

Chef Manage 'group' info wording brain-o

Rendered at https://docs.chef.io/server_orgs.html#default-groups

I believe these:

The admins group is assigned permissions to the following groups by default:

The billing admins group is assigned permissions to the following group by default:

Should match the wording in these that follow those:

The clients group is assigned the following permissions by default to objects on the Chef server:

The users group is assigned the following permissions by default to objects on the Chef server:

Launchd docs are wrong

@jamescott , It looks like some wires are crossed.

resource_osx_profile is completely different from resource_launchd.

It looks like some terminology and actions from osx_profile: https://docs.chef.io/release/12-7/resource_osx_profile.html

Ended up in the documentation for resource_launchd:

https://docs.chef.io/release/12-8/resource_launchd.html

A launchd is not a configuration profile. It is a completely different resource. The way it is referred to in this PR is correct ( "...resource to manage launchd daemons / agents") but in the documentation you linked, it says "A launchd resource to manage configuration profiles (.mobileconfig files) on the Mac OS X platform", which is not correct.

For instance:

resource_osx_profile is a .mobileconfig file

resource_launchd is a .plist file

A resource_launchd is a service like cron or upstart. It is not a configuration profile at all. It is a service.

Thanks for getting the docs updated! Let us know if any further clarification is needed.

Please Document that Partial Search Equals Filter Results

As a customer, I read docs.chef.io for documentation, so I'm thoroughly confused when our docs don't contain the search term "partial search"

It turns out, the term "partial search" is equivalent to the term "filter result".

The only place this important fact is documented is outside of the docs, in https://www.chef.io/blog/2014/12/05/release-chef-client-12-0-0/ at the section "Built in partial search for knife and recipes".

  1. It would be helpful if the explanation from the above link were included in the official docs. It's preferable that anywhere "filter result" is mentioned, that that site in the docs also mention "partial search". Chef spent a year or so acculturating people to the latter term. The most important place that equivalency could be made is probably in https://docs.chef.io/chef_search.html#filter-search-results , so that it is found in searching.

  2. Additionally, verbiage should be added to the introduction for this section to make it apparent that this form of searching would occur as part of a recipe.

    Use :filter_result in a recipe as part of a search query against the Chef server to return data in the form of the specified Hash. This usage with the filter_result option is also known as partial search
    
  3. The following is a working example of a partial search/filter results with knife 12.7.2 against Hosted Chef, which could be included above the previous link, in the section with the other knife search examples

    knife search node "platform:ubuntu" --filter-result "c_version=languages.c.gcc.version, ruby_version=languages.ruby.version"
    

Request for Clarification/Additional Documentation around Handlers, Email Notification

I spent several hours today trying to wrap my head around Handlers and get failure event notification over email working. There are a couple of examples out there, but they all assume a rather high level of understanding about things, especially around where certain configurations should go (in which file, etc).

I got it working with chef_handler, but I basically pieced together stuff from the chef handler documentation, as well as various other places on the internet.

A fully functional, detail walkthrough of how to configure email using chef_handler would probabaly be extremely useful for a lot of people, and especially n00bs to Chef like myself. I'm gonna document my configuration in a Gist and I'll link to it here if it's useful.

Docs on "knife cookbook site" contains error for cookbook unsharing

Hi all! The documentation suggests the following command to be used for unsharing a specific version of a cookbook shared on the Chef Supermarket:

$ knife cookbook site unshare COOKBOOK_NAME/version/VERSION

The request keeps failing with the following message:

Do you really want to unshare all versions of the cookbook dynatrace/version/6.3.0? (Y/N) Y
ERROR: Server returned error 500 for https://supermarket.chef.io/api/v1/cookbooks/dynatrace/version/..., retrying 1/5 in 3s
ERROR: Server returned error 500 for https://supermarket.chef.io/api/v1/cookbooks/dynatrace/version/..., retrying 2/5 in 6s
...

The documentation has to be changed as follows to make unsharing work:

$ knife cookbook site unshare COOKBOOK_NAME/versions/VERSION

HA "Machines are stored as Amazon Elastic Block Store (EBS) volumes"

https://github.com/chef/chef-web-docs/blob/master/includes_server_ha/includes_server_ha_aws.rst

Machines are stored as Amazon Elastic Block Store (EBS) volumes. A passive node monitors the availabilty of the active node, and will take over if required.

Does that say what was meant? I'm not sure. Rendered w/ image above it: https://docs.chef.io/server_high_availability.html

The first sentence confuses me altogether :). I think what it's supposed to say is something like, "Backend servers make use of a single Amazon EBS volume." ?

The second sentence could maybe have minor tweaking to be "The passive back-end node monitors the availabilty of the active back-end node, and will take over if required."

No docs for 12.11 or 12.12

or, more important, no release notes. Would be good to sync, though we should probably sort out how we ended up so far behind.

Analytics install instructions have a 'broken' step

Doc url: https://docs.chef.io/install_analytics.html

Issue: Below step only works in combined mode and presently explodes, leading users to believe something's gone wrong with their Analytics install. There is a pending code fix, however until it's done, best remove it from the doc to avoid extra confusion.

Verify the installation on the Chef Analytics server:
$ opscode-analytics-ctl test

Internal Refs:
https://getchef.zendesk.com/agent/tickets/9620
https://chefio.atlassian.net/browse/TRI-156

Missing steps for user add...

URL: https://docs.chef.io/install_delivery_aws.html

Beneath the Configure Delivery section is the subsection for Add Users (below). It states, "...use the follow procedure to create a new user...", however, that procedure is not included.

Add Users¶
The default admin account should not be used after Delivery is installed. Instead, use the following procedure to create a new user for yourself, then log out as admin and log back in as the user you created.

makefile release target does not exists

From README.MD, Building Docs:

## Building Docs

There's a `Makefile` in the root of the repo, that should have the majority of the tasks you'll ever need.

Run:

    make release

This will build *all* the documentation into HTML, and place it inside `./build/chef/`.
Open `./build/chef/index.html` to view the rendered files locally.

But the target does not exists in the Makefile (master branch) and will cause an error when running it.

[genadi@localhost chef-web-docs]# make release
make: *** No rule to make target `release'.  Stop.

chef 12.5 custom resource - action_class documentation

In order to use helper methods in a custom_resource action_class seems to be the way to go. Action_class is very hard to find in the documentation though. The best doc I can find about using action_class is contained in this comment "Refer to the notes about custom resources if you’re curious about other approaches that use the older styles." Most people don't look there when they are working on a 12.5 style custom resource because of the "older styles" comment.

I'd like to see something inserted into the custom_resources documentation about action_class.

Thanks,
Mark

Mention the word twiddle-wakka in the documentation on versions

I have had the opportunity to teach and discuss Chef to many new users over the past few years. A concept that is hard for users that are not yet accustomed to ruby is the ~>. More over this is a tough set of characters to google search. By using the term twiddle-wakka you give the user something to sync google's teeth into.

While the documentation at https://docs.chef.io/config_rb_metadata.html is currently likely enough to explain:

A range of chef-client versions that are supported by this cookbook.

For example, to match any 12.x version of the chef-client, but not 11.x or 13.x:
chef_version "~> 12"

Providing the word to google and find out more and a link to http://guides.rubygems.org/patterns/#declaring-dependencies will likely give the more curious an avenue to learn more and understand the history.

Chef Server API docs url for client keys is incorrect

The documentation for the clients/client/keys incorrectly uses client/client/keys as the url.

Searching for "client/" on the Chef Server API page will show all the incorrect instances.

https://docs.chef.io/api_chef_server.html

In addition, the raml-docs in the chef-server repo are incorrect. Lines 17 and 20 in the keys.yaml file:

https://github.com/chef/chef-server/blob/bb28b489960c8fae6ac061bf2dab5800142b22a3/src/oc_erchef/raml-docs/organizations/clients/keys.yaml

ctl_ohai incorrectly lists an invalid option

-f FILE_NAME, --file FILE_NAME
The name of an Ohai plugin against which Ohai will run. (Only one Ohai plugin may be specified when using this option.)

-f doesn't work and isn't listed by --help

knife docs for private supermarket need updated

The knife supermarket docs say in a warning at the top:

Only use knife supermarket if you are using a Chef 12.12 or earlier. If you are using Chef 12.13 or later, you should use the knife cookbook site commands.

However, the knife cookbook site docs say nothing about connecting to a private supermarket.

Turns out, however, you an actually set the knife[:supermarket_site] attribute in your knife.rb file and get your knife cookbook site commands to interact with your private supermarket, but I see that documented nowhere besides the knife supermarket and supermarket pages.

So I propose that the knife cookbook site docs need updated to include this config value, or include it in the knife.rb page. Thoughts?

Unused admin parameter still listed on the Chef Server API page

The Chef Server API docs has the admin parameter listed as a usable parameter on the /clients POST and /clients/NAME PUT endpoints.

https://docs.chef.io/api_chef_server.html

The Release Notes for Chef Server 12.1.0 say that:

In client creation and update, the last remnants of the admin flag have been 
removed. It was previously partially supported in that we would capture and 
update the value, but the value was unused in the system. If submitted in 
POST/PUT of a client or user, it is ignored.

https://github.com/chef/chef-server/blob/master/PRIOR_RELEASE_NOTES.md#api-changes-and-additions-2

Delivery CLI Install for Windows doc is wrong

Currently we have

. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install

This will install Chef Client.

For Delivery CLI we can use

. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project delivery-cli -architecture x86_64

Misleading info re: recursive directory deletion

Thanks for the overall excellent core docs! Just wanted to mention a small thing that threw me off today:

In the current docs for resource_directory properties, it says the following:

recursive
Ruby Types: TrueClass, FalseClass

Create or delete parent directories recursively. For the owner, group, and mode properties, the value of this attribute applies only to the leaf directory. Default value: false.

When using action :create , the above applies, and parent directories are created recursively. When using action :delete , it deletes child directories and files recursively. This follows POLA - I was expecting rm -rf , but the docs made it sound like the entire hierarchy would get blown away.

The example under "Delete Directory" looks correct, but it doesn't elaborate on this:

directory '/tmp/something' do
  recursive true
  action :delete
end

From the property text, it looks like this would delete /tmp as well as /tmp/something and presumably /tmp/something/a_file.txt .

Maybe I habitually over-think things, but this threw me off until I tried it out in test-kitchen. A sentence in the attribute text or below the example to clarify the different behavior would be super appreciated. Might help other paranoid over-thinkers and careful-readers 😆

Cheers,

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.