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.
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". | - |
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]"
]
}