commit
592f20c2de
4 changed files with 96 additions and 20 deletions
|
@ -4,15 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<title>Hello World</title>
|
||||
<style>
|
||||
html {
|
||||
height: 100%;
|
||||
background: gray;
|
||||
}
|
||||
|
||||
body {
|
||||
width: 500px;
|
||||
min-height: 100%;
|
||||
|
||||
margin: auto;
|
||||
padding: 5px;
|
||||
|
||||
|
@ -54,14 +46,14 @@
|
|||
<body>
|
||||
<div>
|
||||
[<span class="time">16:01:42</span>]
|
||||
<span class="username">atomaka</span>@<span class="server">162.243.226.212</span>
|
||||
<span class="username">atomaka</span>@<span class="server">tc362.atomaka.com</span>
|
||||
<span class="pwd">~</span><br/>
|
||||
|<span class="good-prompt">-></span> Hello World<br/>
|
||||
zsh: command not found: Hello
|
||||
</div>
|
||||
<div>
|
||||
[<span class="time">16:02:10</span>]
|
||||
<span class="username">atomaka</span>@<span class="server">162.243.226.212</span>
|
||||
<span class="username">atomaka</span>@<span class="server">tc362.atomaka.com</span>
|
||||
<span class="pwd">~</span><br/>
|
||||
|<span class="bad-prompt">-></span> <span class="cursor"> </span>
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
# GROUPS
|
||||
group { 'web':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
# USERS
|
||||
# atomaka, with SSH key
|
||||
user { 'atomaka':
|
||||
ensure => 'present',
|
||||
groups => ['sudo'],
|
||||
ensure => present,
|
||||
groups => ['sudo', 'web'],
|
||||
managehome => true,
|
||||
shell => '/bin/zsh',
|
||||
require => Package['zsh'],
|
||||
require => [ Package['zsh'], Group['web'] ]
|
||||
}
|
||||
file { '/home/atomaka/.ssh':
|
||||
ensure => directory,
|
||||
|
@ -21,6 +27,15 @@ file { '/home/atomaka/.ssh/authorized_keys':
|
|||
content => file('/tmp/puppet/files/keys/atomaka'),
|
||||
require => File['/home/atomaka/.ssh'],
|
||||
}
|
||||
# jeff, with password
|
||||
user { 'jeff':
|
||||
ensure => present,
|
||||
groups => ['web'],
|
||||
managehome => true,
|
||||
shell => '/bin/bash',
|
||||
password => '$6$.AURF9sE09Q$..S10CFY7G.AVXzSW//w6GoV6yPzBzdvyUl8a7oyYbW/XzBU.o6AdHxTgTkCSWb64zmN3QoKovoUyLJhE/MFP/',
|
||||
require => Group['web'],
|
||||
}
|
||||
|
||||
# PACKAGES
|
||||
package { 'mosh': }
|
||||
|
@ -33,21 +48,61 @@ include sudo
|
|||
class { 'ssh::server':
|
||||
require => Class['augeas'],
|
||||
}
|
||||
class { 'apache': }
|
||||
|
||||
class { 'apache':
|
||||
default_vhost => false,
|
||||
}
|
||||
|
||||
# CONFIGURATIONS
|
||||
ssh::server::configline { 'Port': value => '22984' }
|
||||
ssh::server::configline { 'PermitRootLogin': value => 'no' }
|
||||
ssh::server::configline { 'PasswordAuthentication': value => 'no' }
|
||||
ssh::server::configline { 'PasswordAuthentication': value => 'yes' }
|
||||
ssh::server::configline { 'AllowUsers/1': value => 'atomaka' }
|
||||
ssh::server::configline { 'AllowUsers/2': value => 'jeff' }
|
||||
|
||||
sudo::conf { 'sudo':
|
||||
priority => 10,
|
||||
content => "%sudo ALL=(ALL) NOPASSWD: ALL\n",
|
||||
}
|
||||
|
||||
# FILES
|
||||
file { '/var/www/index.html':
|
||||
ensure => present,
|
||||
content => file('/tmp/puppet/files/index.html'),
|
||||
require => Class['apache'],
|
||||
apache::vhost { 'tc362.atomaka.com':
|
||||
default_vhost => true,
|
||||
port => '80',
|
||||
docroot => '/var/www/tc362.atomaka.com',
|
||||
docroot_owner => 'atomaka',
|
||||
docroot_group => 'web',
|
||||
}
|
||||
|
||||
# FILES
|
||||
file { '/var/www/tc362.atomaka.com':
|
||||
ensure => directory,
|
||||
owner => 'atomaka',
|
||||
group => 'web',
|
||||
mode => '2775',
|
||||
before => Apache::Vhost['tc362.atomaka.com'],
|
||||
}
|
||||
|
||||
file { '/var/www/tc362.atomaka.com/index.html':
|
||||
ensure => present,
|
||||
owner => 'atomaka',
|
||||
group => 'web',
|
||||
mode => '0664',
|
||||
content => file('/tmp/puppet/files/index.html'),
|
||||
require => File['/var/www/tc362.atomaka.com'],
|
||||
}
|
||||
|
||||
file { '/home/atomaka/web':
|
||||
ensure => link,
|
||||
owner => 'atomaka',
|
||||
group => 'atomaka',
|
||||
target => '/var/www/tc362.atomaka.com',
|
||||
require => [ User['atomaka'], File['/var/www/tc362.atomaka.com'] ],
|
||||
}
|
||||
|
||||
file { '/home/jeff/web':
|
||||
ensure => link,
|
||||
owner => 'jeff',
|
||||
group => 'jeff',
|
||||
target => '/var/www/tc362.atomaka.com',
|
||||
require => [ User['jeff'], File['/var/www/tc362.atomaka.com'] ],
|
||||
}
|
||||
|
|
28
update.sh
Normal file
28
update.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
# UPDATE SCRIPT - on a more clever day, I might merge this with bootstrap.sh
|
||||
# Can take a single param to allow a specific branch to be installed
|
||||
BRANCH=$1
|
||||
|
||||
# TO BE RUN AS ROOT
|
||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||
echo "This script must be run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
# CLONE PUPPET REPOSITORY
|
||||
cd /tmp
|
||||
rm -rf puppet
|
||||
git clone https://github.com/atomaka/tc362.git puppet
|
||||
cd puppet
|
||||
|
||||
if [ "$BRANCH" != "" ]; then
|
||||
git fetch
|
||||
git checkout $BRANCH
|
||||
fi
|
||||
|
||||
# INSTALL MODULES
|
||||
librarian-puppet install
|
||||
|
||||
# RUN MANIFEST
|
||||
puppet apply manifests/site.pp --modulepath=modules/
|
1
week2/ip.txt
Normal file
1
week2/ip.txt
Normal file
|
@ -0,0 +1 @@
|
|||
162.243.226.212
|
Loading…
Reference in a new issue