tc362/manifests/site.pp

173 lines
4 KiB
ObjectPascal
Raw Normal View History

2014-01-22 09:42:02 -05:00
# GROUPS
group { 'web':
ensure => present,
}
2014-01-15 15:09:51 -05:00
# USERS
# atomaka, with SSH key
2014-01-15 15:09:51 -05:00
user { 'atomaka':
ensure => present,
groups => ['sudo', 'web', 'maverick', 'iceman'],
2014-01-15 15:09:51 -05:00
managehome => true,
shell => '/bin/zsh',
require => [
Package['zsh'],
Group['web'],
User['maverick'],
User['iceman'],
],
2014-01-15 15:09:51 -05:00
}
file { '/home/atomaka/.ssh':
ensure => directory,
owner => 'atomaka',
group => 'atomaka',
mode => '0700',
require => User['atomaka'],
}
file { '/home/atomaka/.ssh/authorized_keys':
ensure => present,
owner => 'atomaka',
group => 'atomaka',
mode => '0600',
2014-01-15 15:34:42 -05:00
content => file('/tmp/puppet/files/keys/atomaka'),
2014-01-15 15:09:51 -05:00
require => File['/home/atomaka/.ssh'],
}
# jeff, with password
user { 'jeff':
ensure => present,
2014-01-22 09:42:02 -05:00
groups => ['web'],
managehome => true,
shell => '/bin/bash',
2014-01-22 09:42:02 -05:00
password => '$6$.AURF9sE09Q$..S10CFY7G.AVXzSW//w6GoV6yPzBzdvyUl8a7oyYbW/XzBU.o6AdHxTgTkCSWb64zmN3QoKovoUyLJhE/MFP/',
require => Group['web'],
}
#maverick and iceman, no login
user { 'maverick':
ensure => present,
shell => '/sbin/nologin',
}
user { 'iceman':
ensure => present,
shell => '/sbin/nologin',
}
2014-01-15 15:09:51 -05:00
# PACKAGES
package { 'mosh': }
package { 'zsh': }
2014-02-06 15:34:21 -05:00
package { 'mailutils': }
2014-01-15 15:09:51 -05:00
# CLASSES
include augeas
2014-01-15 15:47:28 -05:00
include sudo
2014-01-15 15:09:51 -05:00
class { 'ssh::server':
require => Class['augeas'],
}
2014-01-22 09:42:02 -05:00
class { 'apache':
default_vhost => false,
}
2014-01-15 15:09:51 -05:00
# CONFIGURATIONS
2014-02-19 16:23:40 -05:00
ssh::server::configline { 'Port': value => '22984' }
2014-01-15 15:09:51 -05:00
ssh::server::configline { 'PermitRootLogin': value => 'no' }
ssh::server::configline { 'PasswordAuthentication': value => 'yes' }
2014-01-15 15:09:51 -05:00
ssh::server::configline { 'AllowUsers/1': value => 'atomaka' }
ssh::server::configline { 'AllowUsers/2': value => 'jeff' }
2014-01-15 15:09:51 -05:00
2014-01-15 15:47:28 -05:00
sudo::conf { 'sudo':
priority => 10,
content => "%sudo ALL=(ALL) NOPASSWD: ALL\n",
}
2014-01-22 09:42:02 -05:00
apache::vhost { 'tc362.atomaka.com':
default_vhost => true,
port => '80',
docroot => '/var/www/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',
}
2014-01-15 15:09:51 -05:00
# FILES
2014-01-22 09:42:02 -05:00
file { '/var/www/tc362.atomaka.com':
ensure => directory,
owner => 'atomaka',
group => 'web',
mode => '2775',
source => '/tmp/puppet/files/tc362',
recurse => true,
before => Apache::Vhost['tc362.atomaka.com'],
2014-01-22 09:42:02 -05:00
}
file { '/var/www/maverick.atomaka.com':
ensure => directory,
owner => 'maverick',
group => 'maverick',
mode => '2775',
source => '/tmp/puppet/files/maverick',
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'],
2014-01-15 15:09:51 -05:00
}
2014-01-22 11:04:46 -05:00
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/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'] ],
}
2014-01-22 11:04:46 -05:00
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'] ],
}
2014-02-06 15:34:21 -05:00
file { '/etc/profile':
ensure => present,
content => file('/tmp/puppet/files/profile'),
require => Package['mailutils'],
}