neillturner/kitchen-puppet — pull request #4 by arlimus (2014-05-09 17:32:28+00:00)
Title: bugfix: remove destination before copying modules

When using a `Puppetfile`, the user may have already run `librarian-puppet install` (or `r10k`) in his local folder and created all modules inside `modules/`. When the provisioner is now run (`kitchen converge`) it will produce an error (example for ntp module):

```
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #converge action: [Permission denied - /tmp/default-nocm-ubuntu-1204-sandbox-20140509-11381-c0jrxv/modules/ntp/templates/ntp.conf.erb]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
```

This can be avoided by removing the destination files first. The destination files are created from the internal `librarian-puppet` run and can be overwritten if the user has these files in his local folder. This way the user can make adjustment to upstream modules and get them pulled in. All other modules that don't exist yet, will be pulled in as usual from librarian.

Signed-off-by: Dominik Richter