tc362/manifests/site.pp

109 lines
2.5 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,
2014-01-22 09:42:02 -05:00
groups => ['sudo', 'web'],
2014-01-15 15:09:51 -05:00
managehome => true,
shell => '/bin/zsh',
2014-01-22 09:42:02 -05:00
require => [ Package['zsh'], Group['web'] ]
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'],
}
2014-01-15 15:09:51 -05:00
# PACKAGES
package { 'mosh': }
package { 'zsh': }
# 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
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',
}
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',
before => Apache::Vhost['tc362.atomaka.com'],
}
file { '/var/www/tc362.atomaka.com/index.html':
ensure => present,
owner => 'atomaka',
group => 'web',
mode => '0664',
2014-01-15 15:09:51 -05:00
content => file('/tmp/puppet/files/index.html'),
2014-01-22 09:42:02 -05:00
require => File['/var/www/tc362.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/jeff/web':
ensure => link,
owner => 'jeff',
group => 'jeff',
target => '/var/www/tc362.atomaka.com',
require => [ User['jeff'], File['/var/www/tc362.atomaka.com'] ],
}