-
-
Save tPl0ch/3980764 to your computer and use it in GitHub Desktop.
Vagrant setup
This file contains 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
#!/bin/sh | |
NFSUID=`stat -c %u /vagrant/` | |
sudo su -c "cat /etc/passwd | grep -v vagrant:x: > /etc/passwd.new" | |
sudo su -c "echo \"vagrant:x:${NFSUID}:502::/home/vagrant:/bin/bash\" >> /etc/passwd.new" | |
sudo su -c "chown -R ${NFSUID}:vagrant /home/vagrant" | |
sudo su -c "mv -f /etc/passwd.new /etc/passwd" | |
sudo su vagrant -c "mkdir -p /vagrant/http-logs" | |
if [ -d /vagrant/web ] && [ ! -f /vagrant/.vagrant.force.global ] | |
then | |
sudo cp -f /home/vagrant/files/app.conf /etc/httpd/conf.d/vagrant.conf | |
else | |
sudo cp -f /home/vagrant/files/global.conf /etc/httpd/conf.d/vagrant.conf | |
fi | |
sudo /etc/init.d/httpd restart | |
echo "Finished" |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
config.vm.provision OnHostProvisioner | |
end | |
class OnHostProvisioner < Vagrant::Provisioners::Base | |
def provision! | |
env[:vm].channel.execute("/home/vagrant/provision.sh") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment