Permalink
Browse files

Fix the vagrants

Add a new, lean base box, have puppet scripts for most things to
easisly rebuild our box, and have it work out-of-the-box. YAY!
  • Loading branch information...
tofumatt committed Mar 6, 2012
1 parent b7c4d29 commit 701fda7401abb28096408fa3cf11e298563a8deb
View
@@ -16,20 +16,17 @@ CONF = _config
MOUNT_POINT = '/home/vagrant/mozillians'
Vagrant::Config.run do |config|
+ config.vm.box = "mozillians-v1.0"
+ config.vm.box_url = "http://people.mozilla.org/~mmacpherson/mozillians-v1.0.box"
- config.vm.box = "mozillians-v9.box"
- config.vm.box_url = "http://people.mozilla.com/~ddash/mozillians-v9.box"
-
- config.vm.forward_port("web", 8001, 8001)
- config.vm.forward_port("ldap", 1389, 1389)
+ config.vm.forward_port 8000, 8000
# Increase vagrant's patience during hang-y CentOS bootup
# see: https://github.com/jedi4ever/veewee/issues/14
config.ssh.max_tries = 50
config.ssh.timeout = 300
# nfs needs to be explicitly enabled to run.
-
if CONF['nfs'] == false or RUBY_PLATFORM =~ /mswin(32|64)/
config.vm.share_folder("v-root", MOUNT_POINT, ".")
else
@@ -41,12 +38,11 @@ Vagrant::Config.run do |config|
# config.vm.customize ["modifyvm", :id, "--cpuexecutioncap", "90"]
# Add to /etc/hosts: 33.33.33.24 dev.mozillians.org
- config.vm.network "33.33.33.24"
+ config.vm.network :hostonly, "33.33.33.24"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "dev-vagrant.pp"
puppet.module_path = "puppet/modules"
end
-
end
@@ -1,36 +1,47 @@
# Path to your oh-my-zsh configuration.
-export ZSH=$HOME/.oh-my-zsh
+ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
-export ZSH_THEME="cypher"
+# Themes just cause trouble inside vagrant, so we disable them.
+# ZSH_THEME="robbyrussell"
+
+# Example aliases
+# alias zshconfig="mate ~/.zshrc"
+# alias ohmyzsh="mate ~/.oh-my-zsh"
+alias dj="./manage.py"
+alias runserver="dj runserver 0.0.0.0:8000"
+alias rs="runserver"
+alias t="dj test -x --logging-clear-handlers --with-nicedots"
+alias td="FORCE_DB=True t"
+alias tf="dj test --logging-clear-handlers --with-nicedots --failed"
+alias tp="t --pdb --pdb-failure"
# Set to this to use case-sensitive completion
-# export CASE_SENSITIVE="true"
+# CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
-# export DISABLE_AUTO_UPDATE="true"
+DISABLE_AUTO_UPDATE="true"
# Uncomment following line if you want to disable colors in ls
-# export DISABLE_LS_COLORS="true"
+# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
-# export DISABLE_AUTO_TITLE="true"
+# DISABLE_AUTO_TITLE="true"
+
+# Uncomment following line if you want red dots to be displayed while waiting for completion
+# COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
-plugins=()
+plugins=(git django vagrant python pip)
source $ZSH/oh-my-zsh.sh
# Customize to your needs...
-export PATH=$HOME/mozillians/directory/localtest/bin:/usr/local/libexec/:/vagrant/directory/localtest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/ruby/bin/
-. $HOME/.virtualenvs/mozillians/bin/activate
cd $HOME/mozillians
-
-pushd $HOME/mozillians/directory/devslapd/
-. $HOME/mozillians/directory/devslapd/setup.sh
-popd
@@ -10,7 +10,7 @@
ubuntu: {
package {
- [ "git-core", "vim", "emacs" ]:
+ [ "git-core", "vim", "emacs", "zsh" ]:
ensure => installed;
}
}
@@ -0,0 +1,25 @@
+# stage {"pre": before => Stage["main"]} class {'apt': stage => 'pre'}
+
+# Commands to run before all others in puppet.
+class init {
+ group { "puppet":
+ ensure => "present",
+ }
+
+ case $operatingsystem {
+ ubuntu: {
+ exec { "update_apt":
+ command => "sudo apt-get update",
+ }
+
+ # Provides "add-apt-repository" command, useful if you need
+ # to install software from other apt repositories.
+ package { "python-software-properties":
+ ensure => present,
+ require => [
+ Exec['update_apt'],
+ ];
+ }
+ }
+ }
+}
@@ -0,0 +1,15 @@
+class oh_my_zsh {
+ exec { "oh-my-zsh":
+ command => "wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh",
+ require => Package['git-core', 'zsh'],
+ cwd => '/home/vagrant/',
+ user => 'vagrant';
+ #path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin",
+ #refreshonly => true,
+ }
+
+ exec { "change-shell":
+ command => "sudo chsh vagrant /usr/bin/zsh",
+ require => Exec['oh-my-zsh'];
+ }
+}
@@ -18,7 +18,7 @@
# TODO: make this support centos or ubuntu (#centos)
exec { "sql_migrate":
cwd => "$PROJ_DIR",
- command => "/usr/bin/python2.6 ./vendor/src/schematic/schematic migrations/",
+ command => "/usr/bin/python2.6 manage.py syncdb --noinput",
require => [
Service["mysql"],
Package["python2.6-dev", "libapache2-mod-wsgi", "python-wsgi-intercept" ],
@@ -29,4 +29,4 @@
}
}
-}
+}
@@ -12,10 +12,15 @@
$USE_YUM_CACHE_ON_HOST = 0
$USE_SOUTH = 1
-Exec { path => [ "/bin/"] }
+$DONT_REPROVISION = 1
+
+Exec {
+ path => "/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin",
+}
class dev {
class {
+ init: before => Class[dev_hacks];
dev_hacks: before => Class[repos];
repos: before => Class[dev_tools];
dev_tools: before => Class[mysql];
@@ -25,7 +30,21 @@
memcached:;
playdoh_site:;
elasticsearch: version => "0.18.6";
+ # oh_my_zsh:;
+ }
+}
+
+if $DONT_REPROVISION == 1 {
+ file { "$PROJ_DIR/settings/local.py":
+ ensure => file,
+ source => "$PROJ_DIR/settings/local.py-dist";
}
+} else {
+ include dev
}
-include dev
+exec { "es-restart":
+ command => "/usr/local/elasticsearch/bin/service/elasticsearch restart",
+ #path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin",
+ #refreshonly => true,
+}
@@ -17,47 +17,54 @@
class sun_java_6 {
- $release = regsubst(generate("/usr/bin/lsb_release", "-s", "-c"), '(\w+)\s', '\1')
-
- file { "partner.list":
- path => "/etc/apt/sources.list.d/partner.list",
- ensure => file,
- owner => "root",
- group => "root",
- content => "deb http://archive.canonical.com/ $release partner\ndeb-src http://archive.canonical.com/ $release partner\n",
- notify => Exec["apt-get-update"],
- }
+ # $release = regsubst(generate("/usr/bin/lsb_release", "-s", "-c"), '(\w+)\s', '\1')
+
+ # file { "partner.list":
+ # path => "/etc/apt/sources.list.d/partner.list",
+ # ensure => file,
+ # owner => "root",
+ # group => "root",
+ # content => "deb http://archive.canonical.com/ $release partner\ndeb-src http://archive.canonical.com/ $release partner\n",
+ # notify => Exec["apt-get-update"],
+ # require => Exec['add-java'],
+ # }
+
+ # exec { "add-java":
+ # command => "sudo add-apt-repository ppa:ferramroberto/java",
+ # #path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin",
+ # #refreshonly => true,
+ # }
exec { "apt-get-update":
command => "/usr/bin/apt-get update",
refreshonly => true,
}
- package { "debconf-utils":
+ package { ["debconf-utils", "openjdk-6-jre-headless"]:
ensure => installed
}
- exec { "agree-to-jdk-license":
- command => "/bin/echo -e sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true | debconf-set-selections",
- unless => "debconf-get-selections | grep 'sun-java6-jdk.*shared/accepted-sun-dlj-v1-1.*true'",
- path => ["/bin", "/usr/bin"], require => Package["debconf-utils"],
- }
+ # exec { "agree-to-jdk-license":
+ # command => "/bin/echo -e sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true | debconf-set-selections",
+ # unless => "debconf-get-selections | grep 'sun-java6-jdk.*shared/accepted-sun-dlj-v1-1.*true'",
+ # path => ["/bin", "/usr/bin"], require => Package["debconf-utils"],
+ # }
- exec { "agree-to-jre-license":
- command => "/bin/echo -e sun-java6-jre shared/accepted-sun-dlj-v1-1 select true | debconf-set-selections",
- unless => "debconf-get-selections | grep 'sun-java6-jre.*shared/accepted-sun-dlj-v1-1.*true'",
- path => ["/bin", "/usr/bin"], require => Package["debconf-utils"],
- }
+ # exec { "agree-to-jre-license":
+ # command => "/bin/echo -e sun-java6-jre shared/accepted-sun-dlj-v1-1 select true | debconf-set-selections",
+ # unless => "debconf-get-selections | grep 'sun-java6-jre.*shared/accepted-sun-dlj-v1-1.*true'",
+ # path => ["/bin", "/usr/bin"], require => Package["debconf-utils"],
+ # }
- package { "sun-java6-jdk":
- ensure => latest,
- require => [ File["partner.list"], Exec["agree-to-jdk-license"], Exec["apt-get-update"] ],
- }
+ # package { "sun-java6-jdk":
+ # ensure => latest,
+ # require => [ File["partner.list"], Exec["agree-to-jdk-license"], Exec["apt-get-update"] ],
+ # }
- package { "sun-java6-jre":
- ensure => latest,
- require => [ File["partner.list"], Exec["agree-to-jre-license"], Exec["apt-get-update"] ],
- }
+ # package { "sun-java6-jre":
+ # ensure => latest,
+ # require => [ File["partner.list"], Exec["agree-to-jre-license"], Exec["apt-get-update"] ],
+ # }
}
@@ -84,7 +91,7 @@
$esJarfile = "${esName}.jar"
$esServiceRev = "3e0b23d"
- include sun_java_6
+ # include sun_java_6
download_file {
["${esName}.tar.gz"]:
@@ -105,7 +112,7 @@
comment => "Elasticsearch user created by puppet",
managehome => true,
shell => "/bin/false",
- require => [Package["sun-java6-jre"]],
+ #require => [Package["sun-java6-jre"]],
uid => 901
}
View
@@ -6,7 +6,7 @@ from settings import *
# For absoluate urls
DOMAIN = "localhost"
PROTOCOL = "http://"
-PORT = 8001
+PORT = 8000
SITE_URL = '%s%s:%d' % (PROTOCOL, DOMAIN, PORT)
@@ -55,3 +55,5 @@ DEBUG = TEMPLATE_DEBUG = True
ES_DISABLED = False
ES_HOSTS = ['127.0.0.1:9200']
ES_INDEXES = dict(default='mozillians_dev')
+
+CELERY_ALWAYS_EAGER = True

0 comments on commit 701fda7

Please sign in to comment.