This cookbook installs and configures the Python Watcher daemon (https://github.com/greggoryhz/Watcher), which uses the inotify kernel subsystem to monitor for file system changes and perform arbitrary actions.
- Red Hat, CentOS - I will be working on Debian support as I have a system that needs it!
git
- needed to clone the latest version of the tool.python
- required for installing python dependencies and to execute the tool.
Key | Type | Description | Default |
---|---|---|---|
['watcher']['repo_url'] | String | The Git repository to clone the daemon from. | https://github.com/greggoryhz/Watcher.git |
['watcher']['branch'] | String | The branch or commit to checkout and use. | master |
['watcher']['install_path'] | String | Destination for the cloned tool. | /usr/local/watcher |
['watcher']['jobs'] | Array | A set of jobs for the Watcher daemon to manage. | [] |
e.g.
Just include watcher
in your node's run_list
:
{
"name":"my_node",
"run_list": [
"recipe[watcher]"
]
}
This cookbook's resources are for other cookbooks to manage jobs for the daemon.
Manage jobs on the server.
- :create: create a job
- name: name attribute. Name of the job.
- label: description of the task.
- path: file system path to monitor.
- exclude: an array of sub-directories to ignore.
- monitor: file system events to monitor (create, move_to, delete, etc.).
- recursive: should the path be monitored recursively?
- command: the command to be executed following a detected event.
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Authors: Peter Green