mitchellh/vagrant — pull request #1218 by xiwenc (2012-11-02 12:12:34+00:00)
Title: Add support for pre and post commands in puppet provisioner

The current implementation of the puppet provisioner assumes a working DNS system (puppet agents can resolve the master correctly). For a vagrant-puppet environment to be truly independent of externals (e.g. host machine, network) it should be more flexible. This flexibility can be achieved by supporting pre- and post-commands; relative to calling the `puppet agent` command.

This pull request introduces two new attributes of type array:

- pre_commands: array of shell commands to be executed **before** `puppet agent` run
- post_commands: array of shell commands to be executed **after** `puppet agent` run.

Note: by default puppet is forked into the background. If you require sequential execution use one of the following options:

- no-daemonize:
- test

Example usage:
``` ruby
pre_commands = ["echo nameserver 172.16.0.10 > /etc/resolv.conf"]
post_commands = ["echo eureka"]
```

Cheers