Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Remove things that are provisioned by ventriloquist from puppet manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrehm committed Sep 10, 2013
1 parent 93a34a9 commit 69021b0
Showing 1 changed file with 10 additions and 127 deletions.
137 changes: 10 additions & 127 deletions site.pp
Expand Up @@ -20,9 +20,8 @@
##################################
# Misc packages
package { [
'curl', 'imagemagick', 'htop', 'exuberant-ctags', 'tmux',
'libtcmalloc-minimal4', 'vim-nox', 'libv8-dev', 'libsqlite3-dev',
'graphviz']:
'curl', 'imagemagick', 'htop', 'exuberant-ctags', 'tmux', 'libtcmalloc-minimal4',
'vim-nox', 'libsqlite3-dev', 'graphviz', 'wget']:
}

##################################
Expand All @@ -36,19 +35,20 @@
##################################
# Ruby / Rails goodies

wget::fetch { "rake-completion":
source => "https://raw.github.com/calebthompson/dotfiles/master/rake/completion.sh",
destination => "/home/vagrant/completion_scripts/rake",
timeout => 0,
verbose => false,
require => File['/home/vagrant/completion_scripts']
exec {
'download-rake-completion':
command => 'wget https://raw.github.com/calebthompson/dotfiles/master/rake/completion.sh',
creates => '/home/vagrant/completion_scripts/rake',
cwd => '/home/vagrant/completion_scripts',
user => 'vagrant',
require => File['/home/vagrant/completion_scripts'];
}

line {
'source-rake-completion':
file => "/home/vagrant/.bashrc",
line => "source /home/vagrant/completion_scripts/rake",
require => Wget::Fetch['rake-completion'];
require => Exec['download-rake-completion'];

'migrate-alias':
file => '/home/vagrant/.bashrc',
Expand All @@ -59,126 +59,9 @@
line => 'alias rollback="rake db:rollback && RAILS_ENV=test rake db:rollback"';
}

##################################
# NodeJS
include nodejs

package { ['coffee-script', 'istanbul']:
ensure => present,
provider => 'npm',
require => Class['nodejs']
}

##################################
# Heroku Toolbelt
exec {
'wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh':
creates => '/usr/local/heroku/bin/heroku'
}

##################################
# RUBY

$default_ruby = '2.0.0-p195'

file {
'/home/vagrant/.gemrc':
content => "
:verbose: true
gem: --no-ri --no-rdoc
:update_sources: true
:sources:
- http://gems.rubyforge.org
- http://gems.github.com
:backtrace: false
:bulk_threshold: 1000
:benchmark: false
"
}

rbenv::install { 'vagrant': }

rbenv::plugin::rubybuild { 'vagrant': }

rbenv::plugin::rbenvvars { 'vagrant':
require => Rbenv::Install['vagrant']
}

rbenv::compile { $default_ruby:
user => 'vagrant',
global => true
}

rbenv::gem { ['foreman', 'rubygems-bundler', 'tmuxinator', 'lol_dba']:
user => 'vagrant',
ruby => $default_ruby,
require => Rbenv::Compile[$default_ruby]
}

exec { 'gem regenerate_binstubs"':
unless => 'gem list | grep -q rubygems-bundler',
path => "/home/vagrant/.rbenv/bin:/home/vagrant/.rbenv/versions/${default_ruby}/bin:/bin:/usr/bin",
user => 'vagrant',
require => Rbenv::Gem['rubygems-bundler']
}

##################################
# PhantomJS
exec { 'install-phantomjs':
command => 'curl https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | sudo tar xjfv - &&
sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs',
cwd => '/usr/local/share',
creates => '/usr/local/bin/phantomjs'
}

##################################
# Memcached
class { 'memcached':
max_memory => 25,
user => 'root'
}

##################################
# PostgreSQL
package { 'libpq-dev': }
class { 'postgresql::server':
acl => ['host all all 127.0.0.1/32 trust', ],
}
exec {
'vagrant-postgres-user':
command => 'createuser --superuser vagrant 2>/dev/null',
unless => 'psql -c "\du" 2>/dev/null | grep -q vagrant',
user => 'postgres',
require => Class['postgresql::server'];

# Based on https://gist.github.com/ffmike/877447
'fix-psql-default-encoding':
command => 'psql postgres -c "update pg_database set datallowconn = TRUE where datname = \'template0\';"
psql template0 -c "update pg_database set datistemplate = FALSE where datname = \'template1\';"
psql template0 -c "drop database template1;"
psql template0 -c "create database template1 with template = template0 encoding = \'UTF8\';"
psql template0 -c "update pg_database set datistemplate = TRUE where datname = \'template1\';"
psql template1 -c "update pg_database set datallowconn = FALSE where datname = \'template0\';"',
unless => "psql template1 -c 'SHOW SERVER_ENCODING' | grep -q UTF8",
user => 'postgres',
require => Class['postgresql::server']
}

##################################
# Redis
class { 'redis': redis_max_memory => '10mb' }
exec {
'update-rc.d -f redis_6379 defaults 98 02':
creates => '/etc/rc0.d/K02redis_6379',
require => Class['redis']
}

##################################
# ElasticSearch

package { 'openjdk-7-jre-headless': }
exec { 'install-elasticsearch':
command => 'wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.deb -O /tmp/elasticsearch.deb -q &&
dpkg -i /tmp/elasticsearch.deb',
unless => 'dpkg -s elasticsearch 2>/dev/null > /dev/null'
}

0 comments on commit 69021b0

Please sign in to comment.