|
| 1 | +Exec { |
| 2 | + path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'] |
| 3 | +} |
| 4 | + |
1 | 5 | $ar_databases = ['activerecord_unittest', 'activerecord_unittest2']
|
| 6 | +$as_vagrant = 'sudo -u vagrant -H bash -l -c' |
2 | 7 |
|
3 | 8 | # Make sure apt-get -y update runs before anything else.
|
4 | 9 | stage { 'preinstall':
|
5 | 10 | before => Stage['main']
|
6 | 11 | }
|
7 | 12 |
|
8 | 13 | class apt_get_update {
|
9 |
| - exec { '/usr/bin/apt-get -y update': |
10 |
| - user => 'root' |
| 14 | + exec { 'apt-get -y update': |
| 15 | + user => 'root', |
| 16 | + unless => 'test -e /home/vagrant/.rvm' |
11 | 17 | }
|
12 | 18 | }
|
13 | 19 | class { 'apt_get_update':
|
|
97 | 103 | }
|
98 | 104 | class { 'install_core_packages': }
|
99 | 105 |
|
100 |
| -class install_ruby { |
101 |
| - package { 'ruby1.9.3': |
| 106 | +class install_curl { |
| 107 | + package { 'curl': |
102 | 108 | ensure => installed
|
103 | 109 | }
|
| 110 | +} |
| 111 | +class { 'install_curl': } |
104 | 112 |
|
105 |
| - exec { '/usr/bin/gem install bundler --no-rdoc --no-ri': |
106 |
| - unless => '/usr/bin/gem list | grep bundler', |
107 |
| - user => 'root', |
108 |
| - require => Package['ruby1.9.3'] |
| 113 | +class install_rvm { |
| 114 | + exec { "${as_vagrant} 'curl -L https://get.rvm.io | bash -s master'": |
| 115 | + creates => '/home/vagrant/.rvm', |
| 116 | + require => Class['install_curl'] |
| 117 | + } |
| 118 | +} |
| 119 | +class { 'install_rvm': } |
| 120 | + |
| 121 | +class install_ruby { |
| 122 | + exec { "${as_vagrant} 'rvm install 1.9.3 --latest-binary && rvm use 1.9.3 --default'": |
| 123 | + creates => '/home/vagrant/.rvm/bin/ruby', |
| 124 | + require => Class['install_rvm'] |
109 | 125 | }
|
110 | 126 | }
|
111 | 127 | class { 'install_ruby': }
|
112 | 128 |
|
| 129 | +class install_bundler { |
| 130 | + exec { "${as_vagrant} 'gem install bundler --no-rdoc --no-ri'": |
| 131 | + creates => '/home/vagrant/.rvm/bin/bundle', |
| 132 | + require => Class['install_ruby'] |
| 133 | + } |
| 134 | +} |
| 135 | +class { 'install_bundler': } |
| 136 | + |
113 | 137 | class install_nokogiri_dependencies {
|
114 | 138 | package { ['libxml2', 'libxml2-dev', 'libxslt1-dev']:
|
115 | 139 | ensure => installed
|
|
0 commit comments