Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 4df5df0

Browse files
committed
simplifies the default Puppet manifest
1 parent d5cae27 commit 4df5df0

File tree

1 file changed

+44
-59
lines changed

1 file changed

+44
-59
lines changed

puppet/manifests/default.pp

Lines changed: 44 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1+
$ar_databases = ['activerecord_unittest', 'activerecord_unittest2']
2+
$as_vagrant = 'sudo -u vagrant -H bash -l -c'
3+
$home = '/home/vagrant'
4+
15
Exec {
26
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin']
37
}
48

5-
$ar_databases = ['activerecord_unittest', 'activerecord_unittest2']
6-
$as_vagrant = 'sudo -u vagrant -H bash -l -c'
9+
# --- Preinstall Stage ---------------------------------------------------------
710

8-
# Make sure apt-get -y update runs before anything else.
911
stage { 'preinstall':
1012
before => Stage['main']
1113
}
1214

1315
class apt_get_update {
1416
exec { 'apt-get -y update':
15-
user => 'root',
16-
unless => 'test -e /home/vagrant/.rvm'
17+
unless => "test -e ${home}/.rvm"
1718
}
1819
}
1920
class { 'apt_get_update':
2021
stage => preinstall
2122
}
2223

23-
class install_sqlite3 {
24-
package { 'sqlite3':
25-
ensure => installed;
26-
}
24+
# --- SQLite -------------------------------------------------------------------
2725

28-
package { 'libsqlite3-dev':
29-
ensure => installed;
30-
}
26+
package { ['sqlite3', 'libsqlite3-dev']:
27+
ensure => installed;
3128
}
32-
class { 'install_sqlite3': }
29+
30+
# --- MySQL --------------------------------------------------------------------
3331

3432
class install_mysql {
3533
class { 'mysql': }
@@ -60,6 +58,8 @@
6058
}
6159
class { 'install_mysql': }
6260

61+
# --- PostgreSQL ---------------------------------------------------------------
62+
6363
class install_postgres {
6464
class { 'postgresql': }
6565

@@ -88,64 +88,49 @@
8888
}
8989
class { 'install_postgres': }
9090

91-
class install_core_packages {
92-
if !defined(Package['build-essential']) {
93-
package { 'build-essential':
94-
ensure => installed
95-
}
96-
}
91+
# --- Memcached ----------------------------------------------------------------
9792

98-
if !defined(Package['git-core']) {
99-
package { 'git-core':
100-
ensure => installed
101-
}
102-
}
93+
class { 'memcached': }
94+
95+
# --- Packages -----------------------------------------------------------------
96+
97+
package { 'curl':
98+
ensure => installed
10399
}
104-
class { 'install_core_packages': }
105100

106-
class install_curl {
107-
package { 'curl':
108-
ensure => installed
109-
}
101+
package { 'build-essential':
102+
ensure => installed
110103
}
111-
class { 'install_curl': }
112104

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-
}
105+
package { 'git-core':
106+
ensure => installed
118107
}
119-
class { 'install_rvm': }
120108

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']
125-
}
109+
# Nokogiri dependencies.
110+
package { ['libxml2', 'libxml2-dev', 'libxslt1-dev']:
111+
ensure => installed
126112
}
127-
class { 'install_ruby': }
128113

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-
}
114+
# ExecJS runtime.
115+
package { 'nodejs':
116+
ensure => installed
134117
}
135-
class { 'install_bundler': }
136118

137-
class install_nokogiri_dependencies {
138-
package { ['libxml2', 'libxml2-dev', 'libxslt1-dev']:
139-
ensure => installed
140-
}
119+
# --- Ruby ---------------------------------------------------------------------
120+
121+
exec { 'install_rvm':
122+
command => "${as_vagrant} 'curl -L https://get.rvm.io | bash -s master'",
123+
creates => "${home}/.rvm",
124+
require => Package['curl']
141125
}
142-
class { 'install_nokogiri_dependencies': }
143126

144-
class install_execjs_runtime {
145-
package { 'nodejs':
146-
ensure => installed
147-
}
127+
exec { 'install_ruby':
128+
command => "${as_vagrant} 'rvm install 1.9.3 --latest-binary && rvm use 1.9.3 --default'",
129+
creates => "${home}/.rvm/bin/ruby",
130+
require => Exec['install_rvm']
148131
}
149-
class { 'install_execjs_runtime': }
150132

151-
class { 'memcached': }
133+
exec { "${as_vagrant} 'gem install bundler --no-rdoc --no-ri'":
134+
creates => "${home}/.rvm/bin/bundle",
135+
require => Exec['install_ruby']
136+
}

0 commit comments

Comments
 (0)