[c0c52d]: vagrant / manifests / ubuntu-1110-server-amd64.pp Maximize Restore History

Download this file

ubuntu-1110-server-amd64.pp    122 lines (106 with data), 2.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# create puppet group
group { "puppet":
ensure => "present",
}
exec { "package index update":
command => "/usr/bin/apt-get update",
}
# install required system packages
Package { ensure => "installed" }
$packages = [
"git-core",
"subversion",
"python-svn",
"default-jre-headless",
"python-dev",
"libssl-dev",
"libldap2-dev",
"libsasl2-dev",
"libjpeg8-dev",
"zlib1g-dev",
"mongodb-server",
"python-pip"
]
package { $packages:
require => Exec[ "package index update" ],
}
file { '/usr/lib/libz.so':
ensure => 'link',
target => '/usr/lib/x86_64-linux-gnu/libz.so',
require => Package[ "zlib1g-dev" ],
}
file { '/usr/lib/libjpeg.so':
ensure => 'link',
target => '/usr/lib/x86_64-linux-gnu/libjpeg.so',
require => Package[ "libjpeg8-dev" ],
}
# install python pip
exec { "install venv":
command => "/usr/bin/pip install virtualenv",
creates => "/usr/local/bin/virtualenv",
require => Package[ "python-pip" ],
}
# create Allura virtualenv
exec { "create allura venv":
command => "/usr/local/bin/virtualenv --system-site-packages anvil",
cwd => "/home/vagrant",
creates => "/home/vagrant/anvil",
user => "vagrant",
group => "vagrant",
require => Exec[ "install venv" ],
}
# create dir for Allura source
file { "/home/vagrant/src":
ensure => "directory",
owner => "vagrant",
group => "vagrant",
}
# create dir for Allura logs
file { "/var/log/allura":
ensure => "directory",
owner => "vagrant",
group => "vagrant",
}
# clone Allura source from git
exec { "clone repo":
command => "/usr/bin/git clone git://git.code.sf.net/p/allura/git.git forge",
cwd => "/home/vagrant/src",
creates => "/home/vagrant/src/forge",
user => "vagrant",
group => "vagrant",
require => [ File[ "/home/vagrant/src" ], Package[ "git-core" ] ],
}
# install Allura dependencies
exec { "/home/vagrant/anvil/bin/pip install -r requirements.txt":
cwd => "/home/vagrant/src/forge",
user => "vagrant",
group => "vagrant",
timeout => 0,
require => [ Exec[ "clone repo"], Exec[ "create allura venv" ] ],
}
# create SCM repo dirs
file { [ "/home/vagrant/scm", "/home/vagrant/scm/git", "/home/vagrant/scm/hg", "/home/vagrant/scm/svn" ]:
ensure => "directory",
owner => "vagrant",
group => "vagrant",
mode => 777,
}
# create symlinks to repo dirs
file { '/git':
ensure => "link",
target => "/home/vagrant/scm/git",
owner => "vagrant",
group => "vagrant",
}
file { '/hg':
ensure => "link",
target => "/home/vagrant/scm/hg",
owner => "vagrant",
group => "vagrant",
}
file { '/svn':
ensure => "link",
target => "/home/vagrant/scm/svn",
owner => "vagrant",
group => "vagrant",
}