Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
# set the time zone to PDT
exec {'set time':
command => 'echo "America/Los_Angeles" > /etc/timezone; dpkg-reconfigure --frontend noninteractive tzdata',
unless => 'grep "Los_Angeles" /etc/timezone',
}
file {'/vagrant/perforce':
ensure => directory,
}
#
# Setup Perforce
#
exec {'fetch p4':
command => 'wget -O /vagrant/perforce/p4 ftp://ftp.perforce.com/perforce/r13.2/bin.linux26x86_64/p4',
creates => '/vagrant/perforce/p4',
require => File['/vagrant/perforce'],
}
exec {'fetch p4d':
command => 'wget -O /vagrant/perforce/p4d ftp://ftp.perforce.com/perforce/r13.2/bin.linux26x86_64/p4d',
creates => '/vagrant/perforce/p4d',
require => File['/vagrant/perforce'],
}
file {'p4':
path => '/vagrant/perforce/p4',
mode => 0775,
require => Exec['fetch p4'],
}
file {'p4d':
path => '/vagrant/perforce/p4d',
mode => 0775,
require => Exec['fetch p4d'],
}
file {'/usr/local/bin/p4':
source => '/vagrant/perforce/p4',
mode => 0555,
require => File['p4'],
}
exec {'start p4d':
command => '/vagrant/perforce/p4d -d -p 1666 -r /vagrant/perforce',
unless => "/vagrant/perforce/p4 -p 1666 info",
require => [ File['p4d'], File['p4'] ]
}
exec {'fetch sample depot':
command => 'wget -O /vagrant/perforce/sampledepot.tar.gz http://ftp.perforce.com/perforce/tools/sampledepot.tar.gz',
creates => '/vagrant/perforce/sampledepot.tar.gz',
}
exec {'deploy sample depot':
command => 'tar xfz /vagrant/perforce/sampledepot.tar.gz -C /tmp; rm -rf /vagrant/perforce/db.*; cp -Rf /tmp/PerforceSample/* /vagrant/perforce; /vagrant/perforce/p4d -r /vagrant/perforce -jr /vagrant/perforce/checkpoint; /vagrant/perforce/p4 -p 1666 -u bruno passwd -P fooBARbaz',
require => [ Exec['fetch sample depot'], Exec['start p4d'] ],
unless => "find /vagrant/perforce -name jam | grep jam",
}
# setup a startup script for p4d
file {'/etc/init/perforce-server.conf':
source => '/vagrant/manifests/files/perforce-server.conf',
ensure => 'present',
owner => root, group => root, mode => 644,
require => [ File['p4d'], File['p4'] ]
}
#
# Setup Swarm
#
class { 'apache':
mpm_module => 'prefork',
default_vhost => false,
}
apache::mod { 'rewrite': }
exec { "apt-get update":
path => "/usr/bin",
}
package { "build-essential":
ensure => present,
require => Exec["apt-get update"],
}
package { "apache2-prefork-dev":
ensure => present,
require => Exec["apt-get update"],
}
apache::vhost { 'localhost':
port => '80',
docroot => '/var/www/swarm',
serveradmin => 'admin@example.com',
directories => [ { path => '/var/www/swarm',
allow_override => ['All'] },
order => 'Allow, Deny',
allow => 'from all'
],
error_log_file => 'swarm.error.log',
access_log_file => 'swarm.access.log',
access_log_format => 'combined',
docroot_group => 'www-data',
docroot_owner => 'www-data',
notify => Service['httpd'],
}
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #1 | 8433 | Matt Attaway |
Test environement for working with Webkeeper using vagrant. Just sync and type 'vagrant up' |