From a80be2b29961cff76d50753a67afd3874daa0036 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 18 Mar 2014 13:05:07 -0400 Subject: [PATCH 1/6] Create swapfile on initial install --- bootstrap.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 4e88fb4..60f8e61 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -26,6 +26,11 @@ 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 From ae1e2804797c727dbd83daf06da314c16555d855 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 18 Mar 2014 11:43:35 -0400 Subject: [PATCH 2/6] Update packages before upgrade/installs --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 60f8e61..2533559 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -36,7 +36,7 @@ if [ "$SETUP" = true ] ; then 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 From 22109ee0566df163ec994281055a874dd0dca8ef Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 18 Mar 2014 11:21:13 -0400 Subject: [PATCH 3/6] Install new modules for using wordpress --- Puppetfile | 2 ++ Puppetfile.lock | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Puppetfile b/Puppetfile index a8139da..acc5fb2 100644 --- a/Puppetfile +++ b/Puppetfile @@ -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' diff --git a/Puppetfile.lock b/Puppetfile.lock index 38aec92..ce36212 100644 --- a/Puppetfile.lock +++ b/Puppetfile.lock @@ -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) From abf708ee97daa1c97084305b8132b6579418ad23 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 18 Mar 2014 11:21:38 -0400 Subject: [PATCH 4/6] Install PHP, MySQL and Wordpress --- manifests/site.pp | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index 9f9d919..cc117d4 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -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, From e71d14805728db0dfac0bc2d2e5575006aba0933 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 18 Mar 2014 13:21:31 -0400 Subject: [PATCH 5/6] Ignore rbenv file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b97414..dd06cef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ modules/* .tmp/ modules/ +.ruby-version From 5e9ab4cb58a35a1b4b4add3832b87560bad8a39b Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 18 Mar 2014 13:23:19 -0400 Subject: [PATCH 6/6] Add week9 file with wordpress subdomain --- week9/wordpress.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 week9/wordpress.txt diff --git a/week9/wordpress.txt b/week9/wordpress.txt new file mode 100644 index 0000000..e2e89d4 --- /dev/null +++ b/week9/wordpress.txt @@ -0,0 +1 @@ +wordpress.atomaka.com