Project

pristine

0.0
No commit activity in last 3 years
No release in over 3 years
Watches if any file managed by Puppet was modified.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.9.7
 Project Readme

Pristine

Gem Version Reference Status Dependency Status Gem

Watches if any file managed by Puppet was modified.

Installation

$ gem install pristine

Usage

$ pristine -h
Usage: pristine [options]
        --config FILE                Config file
    -l, --log FILE                   Log output
    -f, --files                      Files list to watch
    -h, --help                       Show this message
        --version                    Show version

By default, it will look for the resources /var/lib/puppet/state/resources.txt file generated by Puppet. If your Puppet's statedir differs from /var/lib/puppet/state, use -l FILE to specify the file path.

$ pristine -l /path/to/your/resources.txt

Test it out!

$ git clone https://github.com/carlasouza/pristine.git; cd pristine
$ ./example/create_example_files.sh
$ ./bin/pristine --config config.yaml
W, [2016-04-17T19:18:34.376080 #29074]  WARN -- : /foo/bar does not exist.
I, [2016-04-17T19:18:34.376153 #29074]  INFO -- : /tmp/pristine/example/ watcher created.
I, [2016-04-17T19:18:34.376190 #29074]  INFO -- : /tmp/pristine/example/a watcher created.
I, [2016-04-17T19:18:34.376226 #29074]  INFO -- : /tmp/pristine/example/a/c watcher created.
I, [2016-04-17T19:18:34.376260 #29074]  INFO -- : /tmp/pristine/example/a/d watcher created.
I, [2016-04-17T19:18:34.376292 #29074]  INFO -- : /tmp/pristine/example/b watcher created.

Modify file /tmp/pristine/example/a/c

I, [2016-04-17T19:19:28.959390 #29074]  INFO -- : /tmp/pristine/example/a/c - [:modify]

TODO

  • Arguments sanity check

  • Check if puppet is installed

  • Filter out concats from resources file

  • Check if file or directory

    If directory, monitor recursevly

  • Add :access to files that contain passwords

  • Add a watcher to the file_list file and then reload itself upon modification

  • Remove the syntax requirement from the file list (expects Puppet's generated)

Copyright

Copyright © 2016 Carla Souza <carlasouza.com>.

License GPLv3+: GNU GPL version 3 or later <gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.