Created
March 23, 2012 16:23
-
-
Save jeffrafter/2172431 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #---------------------------------------------------------------------- | |
| # Vagrant quirks | |
| #---------------------------------------------------------------------- | |
| # Vagrant has Ruby in /opt/ruby/bin, but it is not available to `sudo` | |
| # by default. We need to do some sed-fu here in order to enable that. | |
| # This better mimicks production. Ideally, however, we would have a base | |
| # box that exactly mimics production. | |
| if node[:environment] == "development" | |
| node[:sudo][:options] << "!secure_path" | |
| end | |
| ... | |
| # If we're in Vagrant, then we need to make sure the Vagrant user has | |
| # sudo priveleges | |
| sudo_user "vagrant" if node[:instance_role] == "vagrant" | |
| ... | |
| # Reject all other traffic. | |
| if !in_vagrant? | |
| iptables_rule "9_reject_all" do | |
| source "iptables.reject_all.erb" | |
| end | |
| else | |
| Chef::Log.info("In vagrant, not setting up iptables for rejecting all.") | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This provides a simple test of whether we're in a development | |
| # environment. | |
| def in_vagrant? | |
| node[:instance_role] == "vagrant" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment