Merge pull request #8 from atomaka/atomaka/feature/week9

Week 9 Lab
This commit is contained in:
Andrew Tomaka 2014-03-18 13:38:30 -04:00
commit 8dfc069087
6 changed files with 53 additions and 11 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
modules/*
.tmp/
modules/
.ruby-version

View file

@ -1,7 +1,9 @@
forge "http://forge.puppetlabs.com"
mod 'camptocamp/augeas', '0.0.1'
mod 'hunner/wordpress', '0.6.0'
mod 'puppetlabs/apache', '0.10.0'
mod 'puppetlabs/mysql', '2.2.3'
mod 'saz/ssh', '1.2.0'
mod 'saz/sudo', '2.4.3'

View file

@ -2,11 +2,17 @@ FORGE
remote: http://forge.puppetlabs.com
specs:
camptocamp/augeas (0.0.1)
hunner/wordpress (0.6.0)
puppetlabs/concat (>= 1.0.0)
puppetlabs/mysql (>= 2.1.0)
puppetlabs/stdlib (>= 2.3.1)
puppetlabs/apache (0.10.0)
puppetlabs/concat (>= 1.0.0)
puppetlabs/stdlib (>= 2.4.0)
puppetlabs/concat (1.1.0-rc1)
puppetlabs/stdlib (>= 3.0.0)
puppetlabs/mysql (2.2.3)
puppetlabs/stdlib (>= 3.2.0)
puppetlabs/stdlib (4.1.0)
saz/ssh (1.2.0)
puppetlabs/stdlib (>= 2.2.1)
@ -14,7 +20,9 @@ FORGE
DEPENDENCIES
camptocamp/augeas (= 0.0.1)
hunner/wordpress (= 0.6.0)
puppetlabs/apache (= 0.10.0)
puppetlabs/mysql (= 2.2.3)
saz/ssh (= 1.2.0)
saz/sudo (= 2.4.3)

View file

@ -26,12 +26,17 @@ if [[ $(/usr/bin/id -u) -ne 0 ]]; then
fi
if [ "$SETUP" = true ] ; then
# SWAPFILE
dd if=/dev/zero of=/swapfile bs=1024 count=512k
mkswap /swapfile
swapon /swapfile
# SET TIMESTAMP
echo "America/New_York" | tee /etc/timezone
dpkg-reconfigure --frontend noninteractive tzdata
# UPGRADE ALL CURRENT PACKAGES
apt-get upgrade -y && apt-get dist-upgrade -y
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
# INSTALL GIT
apt-get install git -y

View file

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

1
week9/wordpress.txt Normal file
View file

@ -0,0 +1 @@
wordpress.atomaka.com