Install PHP, MySQL and Wordpress

This commit is contained in:
Andrew Tomaka 2014-03-18 11:21:38 -04:00
parent 22109ee056
commit abf708ee97

View file

@ -7,7 +7,7 @@ group { 'web':
# atomaka, with SSH key # atomaka, with SSH key
user { 'atomaka': user { 'atomaka':
ensure => present, ensure => present,
groups => ['sudo', 'web', 'maverick', 'iceman'], groups => ['sudo', 'web', 'maverick', 'iceman', 'wordpress'],
managehome => true, managehome => true,
shell => '/bin/zsh', shell => '/bin/zsh',
require => [ require => [
@ -15,6 +15,7 @@ user { 'atomaka':
Group['web'], Group['web'],
User['maverick'], User['maverick'],
User['iceman'], User['iceman'],
User['wordpress'],
], ],
} }
file { '/home/atomaka/.ssh': file { '/home/atomaka/.ssh':
@ -41,7 +42,7 @@ user { 'jeff':
password => '$6$.AURF9sE09Q$..S10CFY7G.AVXzSW//w6GoV6yPzBzdvyUl8a7oyYbW/XzBU.o6AdHxTgTkCSWb64zmN3QoKovoUyLJhE/MFP/', password => '$6$.AURF9sE09Q$..S10CFY7G.AVXzSW//w6GoV6yPzBzdvyUl8a7oyYbW/XzBU.o6AdHxTgTkCSWb64zmN3QoKovoUyLJhE/MFP/',
require => Group['web'], require => Group['web'],
} }
#maverick and iceman, no login #maverick, iceman, and wordpress with no login
user { 'maverick': user { 'maverick':
ensure => present, ensure => present,
shell => '/sbin/nologin', shell => '/sbin/nologin',
@ -50,6 +51,10 @@ user { 'iceman':
ensure => present, ensure => present,
shell => '/sbin/nologin', shell => '/sbin/nologin',
} }
user { 'wordpress':
ensure => present,
shell => '/sbin/nologin',
}
# PACKAGES # PACKAGES
package { 'mosh': } package { 'mosh': }
@ -60,12 +65,25 @@ package { 'mailutils': }
include augeas include augeas
include sudo include sudo
class { 'ssh::server': class { '::ssh::server':
require => Class['augeas'], require => Class['augeas'],
} }
class { 'apache': class { '::apache':
default_vhost => false, default_vhost => false,
mpm_module => 'prefork',
}
class { '::apache::mod::php': }
class { '::mysql::server': }
class { '::mysql::bindings':
php_enable => true,
}
class { '::wordpress':
wp_owner => 'root',
wp_group => 'wordpress',
install_dir => '/var/www/wordpress.atomaka.com',
} }
# CONFIGURATIONS # CONFIGURATIONS
@ -87,20 +105,24 @@ apache::vhost { 'tc362.atomaka.com':
docroot_owner => 'atomaka', docroot_owner => 'atomaka',
docroot_group => 'web', docroot_group => 'web',
} }
apache::vhost { 'maverick.atomaka.com': apache::vhost { 'maverick.atomaka.com':
port => '80', port => '80',
docroot => '/var/www/maverick.atomaka.com', docroot => '/var/www/maverick.atomaka.com',
docroot_owner => 'maverick', docroot_owner => 'maverick',
docroot_group => 'maverick', docroot_group => 'maverick',
} }
apache::vhost { 'iceman.atomaka.com': apache::vhost { 'iceman.atomaka.com':
port => '80', port => '80',
docroot => '/var/www/iceman.atomaka.com', docroot => '/var/www/iceman.atomaka.com',
docroot_owner => 'iceman', docroot_owner => 'iceman',
docroot_group => 'iceman', docroot_group => 'iceman',
} }
apache::vhost { 'wordpress.atomaka.com':
port => '80',
docroot => '/var/www/wordpress.atomaka.com',
docroot_owner => 'wordpress',
docroot_group => 'wordpress',
}
# FILES # FILES
file { '/var/www/tc362.atomaka.com': file { '/var/www/tc362.atomaka.com':
@ -112,7 +134,6 @@ file { '/var/www/tc362.atomaka.com':
recurse => true, recurse => true,
before => Apache::Vhost['tc362.atomaka.com'], before => Apache::Vhost['tc362.atomaka.com'],
} }
file { '/var/www/maverick.atomaka.com': file { '/var/www/maverick.atomaka.com':
ensure => directory, ensure => directory,
owner => 'maverick', owner => 'maverick',
@ -122,7 +143,6 @@ file { '/var/www/maverick.atomaka.com':
recurse => true, recurse => true,
before => Apache::Vhost['maverick.atomaka.com'], before => Apache::Vhost['maverick.atomaka.com'],
} }
file { '/var/www/iceman.atomaka.com': file { '/var/www/iceman.atomaka.com':
ensure => directory, ensure => directory,
owner => 'iceman', owner => 'iceman',
@ -140,7 +160,6 @@ file { '/home/atomaka/web':
target => '/var/www/tc362.atomaka.com', target => '/var/www/tc362.atomaka.com',
require => [ User['atomaka'], File['/var/www/tc362.atomaka.com'] ], require => [ User['atomaka'], File['/var/www/tc362.atomaka.com'] ],
} }
file { '/home/atomaka/maverick': file { '/home/atomaka/maverick':
ensure => link, ensure => link,
owner => 'atomaka', owner => 'atomaka',
@ -148,7 +167,6 @@ file { '/home/atomaka/maverick':
target => '/var/www/maverick.atomaka.com', target => '/var/www/maverick.atomaka.com',
require => [ User['atomaka'], File['/var/www/maverick.atomaka.com'] ], require => [ User['atomaka'], File['/var/www/maverick.atomaka.com'] ],
} }
file { '/home/atomaka/iceman': file { '/home/atomaka/iceman':
ensure => link, ensure => link,
owner => 'atomaka', owner => 'atomaka',
@ -156,6 +174,13 @@ file { '/home/atomaka/iceman':
target => '/var/www/iceman.atomaka.com', target => '/var/www/iceman.atomaka.com',
require => [ User['atomaka'], File['/var/www/iceman.atomaka.com'] ], require => [ User['atomaka'], File['/var/www/iceman.atomaka.com'] ],
} }
file { '/home/atomaka/wordpress':
ensure => link,
owner => 'atomaka',
group => 'atomaka',
target => '/var/www/wordpress.atomaka.com',
require => [ User['atomaka'], File['/var/www/wordpress.atomaka.com'] ],
}
file { '/home/jeff/web': file { '/home/jeff/web':
ensure => link, ensure => link,