Created
March 7, 2011 03:19
-
-
Save nathany/858008 to your computer and use it in GitHub Desktop.
Revisions
-
nathany revised this gist
Mar 8, 2011 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -15,4 +15,9 @@ def _prepare(): def apt(pkg): _prepare(); sudo("apt-get -qqyu install %s" % pkg) def has_apt(pkg): with settings( hide('warnings','stdout'), warn_only=True): result = sudo('dpkg --status %s | grep "ok installed"' % pkg) return result.succeeded -
nathany created this gist
Mar 7, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ Vagrant::Config.run do |config| # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "debian_squeeze_32" # The url from where the 'config.vm.box' box will be fetched if it # doesn't already exist on the user's system. config.vm.box_url = "http://mathie-vagrant-boxes.s3.amazonaws.com/debian_squeeze_32.box" # Assign this VM to a host only network IP, allowing you to access it via the IP. config.vm.network "33.33.33.10" # Forward a port from the guest to the host, which allows for outside # computers to access the VM, whereas host only networking does not. # config.vm.forward_port "http", 80, 8080 # Share an additional folder to the guest VM. The first argument is # an identifier, the second is the path on the guest to mount the # folder, and the third is the path on the host to the actual folder. # config.vm.share_folder "v-data", "/vagrant_data", "../data" 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ from fabric.api import * def update(): "Updates Debian/Ubuntu's package list" sudo('apt-get -yqq update') def upgrade(): "Perform a safe upgrade" update() sudo('aptitude -yvq safe-upgrade') # @runs_once def _prepare(): sudo("export DEBCONF_TERSE=yes DEBIAN_PRIORITY=critical DEBIAN_FRONTEND=noninteractive") def apt(pkg): _prepare(); sudo("apt-get -qqyu install %s" % pkg) 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ from fabric.api import * from deb import update, upgrade import deb def vagrant(): "Use Vagrant for testing" env.user = 'vagrant' env.hosts = ['33.33.33.10'] # retrieve the IdentityFile: result = local('vagrant ssh_config | grep IdentityFile', capture=True) env.key_filename = result.split()[1] # parse IdentityFile def host_type(): run('uname -s') def nginx(): deb.apt('nginx')