Skip to content

Latest commit

 

History

History
62 lines (55 loc) · 1.18 KB

README.md

File metadata and controls

62 lines (55 loc) · 1.18 KB

dirs Cookbook

A very simple cookbook to create directories and set permissions.

If the directory doesn't exist, it is created. If it already exists, it has its permissions set.

Attributes

dirs::default

Key Type Description Default
['dirs']['create'] Array Array of directories to be created or have its permissions set. []
['dirs']['create'][n] Hash A hash with the attributes for a directory. Accepts the attributes "path", "user", "group" and "chmod". -

Usage

dirs::default

Just include dirs in your node's run_list and specify the attributes:

{
  "name":"my_node",
  "dirs": {
    "create": [
      {
        "path": "/var/www/my-app",
        "user": "my-user",
        "group": "my-group",
        "chmod": "0755"
      },
      {
        "path": "/etc/my-app",
        "user": "root",
        "group": "root",
        "chmod": "0700"
      }
    ]
  },
  "run_list": [
    "recipe[dirs]"
  ]
}