Skip to content

Commit

Permalink
starting 3.0 branch, vagrant works, not integrated into tests yet
Browse files Browse the repository at this point in the history
  • Loading branch information
parisholley committed Sep 17, 2014
1 parent 9577cc8 commit 681ed7b
Show file tree
Hide file tree
Showing 1,178 changed files with 389,754 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea/
.vagrant/
*.pid*
*.jar*
*.zip*
Expand Down
19 changes: 19 additions & 0 deletions VagrantFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Vagrant.configure("2") do |config|
config.vm.box = "trusty64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"

config.vm.network :forwarded_port, guest: 80, host: 8080

config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.module_path = "puppet/modules"
puppet.manifest_file = "init.pp"
puppet.options="--verbose --debug"
end

# Fix for slow external network connections
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']
end
end
2 changes: 2 additions & 0 deletions files/etc/apache2/httpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User vagrant
Group vagrant
1 change: 1 addition & 0 deletions files/etc/apache2/mods-available/rewrite.load
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
31 changes: 31 additions & 0 deletions files/etc/apache2/sites-available/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /vagrant/wordpress

# correct caching issue where edited images do not refresh http://www.mabishu.com/blog/2013/05/07/solving-caching-issues-with-vagrant-on-vboxsf/
EnableSendfile off

# phpmyadmin routing
Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /vagrant/wordpress>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</Directory>

ErrorLog ${APACHE_LOG_DIR}/vagrantpress.error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/vagrantpress.access.log combined
</VirtualHost>
13 changes: 13 additions & 0 deletions puppet/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
exec { 'apt_update':
command => 'apt-get update',
path => '/usr/bin'
}

class { 'git::install': }
class { 'subversion::install': }
class { 'apache2::install': }
class { 'php5::install': }
class { 'mysql::install': }
class { 'wordpress::install': }
class { 'phpmyadmin::install': }
class { 'phpqa::install': }
50 changes: 50 additions & 0 deletions puppet/modules/apache2/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Install Apache

class apache2::install {

File {
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
require => Package['apache2'],
notify => Service['apache2'],
}

package { 'apache2':
ensure => present,
}->

service { 'apache2':
ensure => running,
}

# the httpd.conf change the user/group that apache uses to run its process
file { '/etc/apache2/conf-available/user.conf':
source => '/vagrant/files/etc/apache2/httpd.conf',
}

file { '/etc/apache2/conf-enabled/user.conf':
ensure => link,
target => '/etc/apache2/conf-available/user.conf',
}

file { '/etc/apache2/sites-available/default.conf':
source => '/vagrant/files/etc/apache2/sites-available/default.conf',
}

file { '/etc/apache2/mods-available/rewrite.load':
source => '/vagrant/files/etc/apache2/mods-available/rewrite.load',
}

file { '/etc/apache2/sites-enabled/000-default.conf':
ensure => link,
target => '/etc/apache2/sites-available/default.conf',
}

file { '/etc/apache2/mods-enabled/rewrite.load':
ensure => link,
target => '/etc/apache2/mods-available/rewrite.load',
}

}
9 changes: 9 additions & 0 deletions puppet/modules/git/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Install git

class git::install {

package{'git':
ensure=>present,
}

}
25 changes: 25 additions & 0 deletions puppet/modules/mysql/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#Install MySQL

class mysql::install {

$password = 'vagrant'

package { [
'mysql-client',
'mysql-server',
]:
ensure => installed,
}

exec { 'Set MySQL server\'s root password':
subscribe => [
Package['mysql-server'],
Package['mysql-client'],
],
refreshonly => true,
unless => "mysqladmin -uroot -p${password} status",
path => '/bin:/usr/bin',
command => "mysqladmin -uroot password ${password}",
}

}
36 changes: 36 additions & 0 deletions puppet/modules/php5/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Install PHP

class php5::install {

package { [
'php5',
'php5-mysql',
'php5-curl',
'php5-gd',
'php5-fpm',
'libapache2-mod-php5',
'php5-dev',
'php5-xdebug',
'php-pear',
]:
ensure => present,
}

# upgrade pear
exec {"pear upgrade":
command => "/usr/bin/pear upgrade",
require => Package['php-pear'],
}

# set channels to auto discover
exec { "pear auto_discover" :
command => "/usr/bin/pear config-set auto_discover 1",
require => [Package['php-pear']]
}

# update channels
exec { "pear update-channels" :
command => "/usr/bin/pear update-channels",
require => [Package['php-pear']]
}
}
16 changes: 16 additions & 0 deletions puppet/modules/phpmyadmin/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Install phpMyAdmin

class phpmyadmin::install {

package { 'phpmyadmin':
ensure => present,
}

file { '/etc/apache2/sites-enabled/001-phpmyadmin':
ensure => link,
target => '/etc/phpmyadmin/apache.conf',
require => Package['apache2'],
notify => Service['apache2'],
}

}
66 changes: 66 additions & 0 deletions puppet/modules/phpqa/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#Install the PHP Quality Assurance Toolchain

class phpqa::install{
exec {"pear install phpunit":
command => "/usr/bin/pear install --alldeps pear.phpunit.de/PHPUnit",
creates => '/usr/bin/phpunit',
require => Exec['pear update-channels']
}

# install phploc
exec {"pear install phploc":
command => "/usr/bin/pear install --alldeps pear.phpunit.de/phploc",
creates => '/usr/bin/phploc',
require => Exec['pear update-channels']
}

# install phpcpd
exec {"pear install phpcpd":
command => "/usr/bin/pear install --alldeps pear.phpunit.de/phpcpd",
creates => '/usr/bin/phpcpd',
require => Exec['pear update-channels']
}

# install phpdcd
exec {"pear install phpdcd":
command => "/usr/bin/pear install --alldeps pear.phpunit.de/phpdcd-beta",
creates => '/usr/bin/phpdcd',
require => Exec['pear update-channels']
}

# install phpcs
exec {"pear install phpcs":
command => "/usr/bin/pear install --alldeps PHP_CodeSniffer",
creates => '/usr/bin/phpcs',
require => Exec['pear update-channels']
}

# install WordPress Coding Standard sniffs
# http:////github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
exec { "Install WP phpcs sniffs":
command => "/usr/bin/git clone git://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $(pear config-get php_dir)/PHP/CodeSniffer/Standards/WordPress",
unless => "/usr/bin/test -d $(pear config-get php_dir)/PHP/CodeSniffer/Standards/WordPress",
require => Exec['pear update-channels', 'pear install phpcs']
}

# install phpdepend
exec {"pear install pdepend":
command => "/usr/bin/pear install --alldeps pear.pdepend.org/PHP_Depend-beta",
creates => '/usr/bin/pdepend',
require => Exec['pear update-channels']
}

# install phpmd
exec {"pear install phpmd":
command => "/usr/bin/pear install --alldeps pear.phpmd.org/PHP_PMD",
creates => '/usr/bin/phpmd',
require => Exec['pear update-channels']
}

# install PHP_CodeBrowser
exec {"pear install PHP_CodeBrowser":
command => "/usr/bin/pear install --alldeps pear.phpunit.de/PHP_CodeBrowser",
creates => '/usr/bin/phpcb',
require => Exec['pear update-channels']
}
}
8 changes: 8 additions & 0 deletions puppet/modules/subversion/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Install subversion

class subversion::install {
package {
'subversion':
ensure => present,
}
}
Loading

0 comments on commit 681ed7b

Please sign in to comment.