Merge pull request #6 from atomaka/atomaka/feature/week6

Week 6 Lab
This commit is contained in:
Andrew Tomaka 2014-02-19 11:20:19 -05:00
commit a1819a7d9d
7 changed files with 133 additions and 15 deletions

BIN
files/iceman/iceman.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

29
files/iceman/index.html Normal file
View file

@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Iceman</title>
<style>
html {
background: black url(iceman.jpg) no-repeat;
background-size: 100%;
}
body {
text-align: center;
font-size: 5em;
color: white;
text-shadow:
-1px -1px 0 #000,
1px -1px 0 #000,
-1px 1px 0 #000,
1px 1px 0 #000;
}
</style>
</head>
<body>
You can be my wingman any time.
</body>
</html>

29
files/maverick/index.html Normal file
View file

@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Maverick</title>
<style>
html {
background: black url(maverick.jpg) no-repeat;
background-size: 100%;
}
body {
text-align: center;
font-size: 5em;
color: white;
text-shadow:
-1px -1px 0 #000,
1px -1px 0 #000,
-1px 1px 0 #000,
1px 1px 0 #000;
}
</style>
</head>
<body>
Bullshit! You can be mine.
</body>
</html>

BIN
files/maverick/maverick.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

View file

@ -7,10 +7,15 @@ group { 'web':
# atomaka, with SSH key # atomaka, with SSH key
user { 'atomaka': user { 'atomaka':
ensure => present, ensure => present,
groups => ['sudo', 'web'], groups => ['sudo', 'web', 'maverick', 'iceman'],
managehome => true, managehome => true,
shell => '/bin/zsh', shell => '/bin/zsh',
require => [ Package['zsh'], Group['web'] ] require => [
Package['zsh'],
Group['web'],
User['maverick'],
User['iceman'],
],
} }
file { '/home/atomaka/.ssh': file { '/home/atomaka/.ssh':
ensure => directory, ensure => directory,
@ -36,6 +41,15 @@ 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
user { 'maverick':
ensure => present,
shell => '/sbin/nologin',
}
user { 'iceman':
ensure => present,
shell => '/sbin/nologin',
}
# PACKAGES # PACKAGES
package { 'mosh': } package { 'mosh': }
@ -55,7 +69,7 @@ class { 'apache':
} }
# CONFIGURATIONS # CONFIGURATIONS
ssh::server::configline { 'Port': value => '22984' } ssh::server::configline { 'Port': value => '22985' }
ssh::server::configline { 'PermitRootLogin': value => 'no' } ssh::server::configline { 'PermitRootLogin': value => 'no' }
ssh::server::configline { 'PasswordAuthentication': value => 'yes' } ssh::server::configline { 'PasswordAuthentication': value => 'yes' }
ssh::server::configline { 'AllowUsers/1': value => 'atomaka' } ssh::server::configline { 'AllowUsers/1': value => 'atomaka' }
@ -74,22 +88,49 @@ apache::vhost { 'tc362.atomaka.com':
docroot_group => 'web', 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',
}
# FILES # FILES
file { '/var/www/tc362.atomaka.com': file { '/var/www/tc362.atomaka.com':
ensure => directory, ensure => directory,
owner => 'atomaka', owner => 'atomaka',
group => 'web', group => 'web',
mode => '2775', mode => '2775',
source => '/tmp/puppet/files/tc362',
recurse => true,
before => Apache::Vhost['tc362.atomaka.com'], before => Apache::Vhost['tc362.atomaka.com'],
} }
file { '/var/www/tc362.atomaka.com/index.html': file { '/var/www/maverick.atomaka.com':
ensure => present, ensure => directory,
owner => 'atomaka', owner => 'maverick',
group => 'web', group => 'maverick',
mode => '0664', mode => '2775',
content => file('/tmp/puppet/files/index.html'), source => '/tmp/puppet/files/maverick',
require => File['/var/www/tc362.atomaka.com'], recurse => true,
before => Apache::Vhost['maverick.atomaka.com'],
}
file { '/var/www/iceman.atomaka.com':
ensure => directory,
owner => 'iceman',
group => 'iceman',
mode => '2775',
source => '/tmp/puppet/files/iceman',
recurse => true,
before => Apache::Vhost['iceman.atomaka.com'],
} }
file { '/home/atomaka/web': file { '/home/atomaka/web':
@ -100,6 +141,22 @@ file { '/home/atomaka/web':
require => [ User['atomaka'], File['/var/www/tc362.atomaka.com'] ], require => [ User['atomaka'], File['/var/www/tc362.atomaka.com'] ],
} }
file { '/home/atomaka/maverick':
ensure => link,
owner => 'atomaka',
group => 'atomaka',
target => '/var/www/maverick.atomaka.com',
require => [ User['atomaka'], File['/var/www/maverick.atomaka.com'] ],
}
file { '/home/atomaka/iceman':
ensure => link,
owner => 'atomaka',
group => 'atomaka',
target => '/var/www/iceman.atomaka.com',
require => [ User['atomaka'], File['/var/www/iceman.atomaka.com'] ],
}
file { '/home/jeff/web': file { '/home/jeff/web':
ensure => link, ensure => link,
owner => 'jeff', owner => 'jeff',

3
week6/subdomains.txt Normal file
View file

@ -0,0 +1,3 @@
162.243.226.212
* iceman.atomaka.com
* maverick.atomaka.com