Skip to content

Commit

Permalink
Fixes bug 1261879 - Vagrant fixes
Browse files Browse the repository at this point in the history
* make memory default to 1024 but configurable via environment
  variable
* make puppet debug output configurable via environment variable
* add breakpad_rw postgres role
  • Loading branch information
willkg committed Apr 5, 2016
1 parent bf1077d commit f092652
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Vagrantfile
@@ -1,14 +1,21 @@
is_jenkins = ENV['USER'] == 'jenkins'
# Whether or not this is jenkins user
IS_JENKINS = ENV['USER'] == 'jenkins'

# Specify how much memory to use
VAGRANT_MEMORY = (ENV['VAGRANT_MEMORY'] || '1024').to_i

# Specify whether or not to enable Puppet debug output
PUPPET_DEBUG = (ENV['VAGRANT_PUPPET_DEBUG'] || '0') == '1'

Vagrant.configure("2") do |config|
config.vm.box = "puppetlabs/centos-7.0-64-puppet"

config.vm.provider "virtualbox" do |v|
v.name = "socorro-vm"
v.memory = 512
v.memory = VAGRANT_MEMORY
end

if not is_jenkins
if not IS_JENKINS
# Don't share these resources when on Jenkins. We want to be able to
# parallelize jobs.

Expand All @@ -24,7 +31,10 @@ Vagrant.configure("2") do |config|
puppet.environment = "vagrant"
puppet.manifests_path = "puppet/vagrant/manifests"
puppet.manifest_file = "vagrant.pp"
# enable this to see verbose and debug puppet output
#puppet.options = "--verbose --debug"

if PUPPET_DEBUG
# Enables puppet debug output
puppet.options = "--verbose --debug"
end
end
end
14 changes: 14 additions & 0 deletions puppet/vagrant/modules/socorro/manifests/init.pp
Expand Up @@ -138,6 +138,20 @@
]
}

exec {
'postgres-breakpad-rw-role':
path => '/usr/bin:/bin',
cwd => '/var/lib/pgsql',
command => 'sudo -u postgres psql template1 -c "create user breakpad_rw with encrypted password \'aPassword\' superuser"',
unless => 'sudo -u postgres psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'breakpad_rw\'" | grep -q 1',
require => [
Package['postgresql94-server'],
Exec['postgres-initdb'],
File['pg_hba.conf'],
Service['postgresql-9.4']
]
}

package {
[
'python-virtualenv',
Expand Down

0 comments on commit f092652

Please sign in to comment.