zts / chef-cookbook-managed_directory

An LWRP to purge unmanaged files from a directory.
16 stars 17 forks source link

Description

Provides a custom resource to declare that a directory's contents are entirely managed by Chef. When a node is converged, any files present in the managed_directory that are not managed by Chef will be removed.

Requirements

Platform

Known to work on CentOS and OS X. Should work on other Unix-like systems.

Resource

managed_directory

Ensure that a directory contains only files put there by Chef in this run. Any other files will be removed.

Actions

Attribute Parameters

Usage

default

Include the default recipe in a run list to make the resource available in your run.

test

The 'test' recipe illustrates use of the managed_directory resource.

test_directories

The 'test_directories' recipe illustrates use of the managed_directory resource when having it clean up unwanted subdirectories.

Caveats

License and Author

Authors:

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.