This is a test repo allows you to test remote_directory resource.

Setup

cd /tmp
git clone https://mhorbul@github.com/mhorbul/remote-directory-notification.git
cd remote-directory-notification
bundle install

Run

  • Make sure you do not have target folder and flag file.
ls -al /tmp | grep foo
  • Run chef-solo
chef-solo -c solo.rb
  • Make sure target folder is created and flag file is in /tmp.
ls -al /tmp | grep foo
  • Run chef-solo again
chef-solo -c solo.rb
  • Flag file /tmp/foo.updated has been removed by recipe and never created back by execute resource via notification because /tmp/foo has not been changed.
ls -al /tmp/foo.updated
  • Modify or remove file(s) in the /tmp/foo folder. And run chef-solo again.
echo 2 > /tmp/foo/1/1.txt
chf-solo -c solo.rb
  • Make sure target folder is upadted to the initial state and flag file is in /tmp.
cat /tmp/foo/1/1.txt
ls -al /tmp/foo.updated