Commit a1f34a4f authored by mh's avatar mh
Browse files

added uid_name to the rest of the defines

parent 8094f570
......@@ -14,6 +14,7 @@
define webhosting::modperl(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -43,9 +44,15 @@ define webhosting::modperl(
$nagios_check_code = 'OK',
$mod_security = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -94,22 +101,22 @@ define webhosting::modperl(
}
Apache::Vhost::Modperl[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
documentroot_mode => 0750,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
}
if ($user_provider == 'local') {
Apache::Vhost::Modperl[$name]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
}
default: {
if ($user_provider == 'local') {
Apache::Vhost::Modperl[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -19,6 +19,7 @@
define webhosting::passenger(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$user_access = 'sftp',
......@@ -66,6 +67,7 @@ define webhosting::passenger(
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
user_access => $user_access,
......@@ -106,6 +108,11 @@ define webhosting::passenger(
}
case $run_mode {
'itk': {
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
if ($run_uid_name == 'absent'){
$real_run_uid_name = "${name}_run"
} else {
......@@ -117,22 +124,22 @@ define webhosting::passenger(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Passenger[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
documentroot_mode => 0750,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
}
if ($user_provider == 'local') {
Apache::Vhost::Passenger[$name]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
}
default: {
if ($user_provider == 'local') {
Apache::Vhost::Passenger[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -29,6 +29,7 @@
define webhosting::php(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$user_access = 'sftp',
......@@ -77,10 +78,16 @@ define webhosting::php(
$real_group = $group
}
}
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
user_access => $user_access,
......@@ -137,22 +144,22 @@ define webhosting::php(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Standard[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
documentroot_mode => 0750,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
}
if ($user_provider == 'local') {
Apache::Vhost::Php::Standard[$name]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
}
default: {
if ($user_provider == 'local') {
Apache::Vhost::Php::Standard[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::drupal(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -56,9 +57,15 @@ define webhosting::php::drupal(
$manage_directories = true,
$manage_cron = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -113,8 +120,8 @@ define webhosting::php::drupal(
ensure => $ensure,
git_repo => $git_repo,
projectroot => $documentroot,
cloneddir_user => $name,
cloneddir_group => $name,
cloneddir_user => $real_uid_name,
cloneddir_group => $real_uid_name,
before => Apache::Vhost::Php::Drupal[$name],
}
apache::vhost::file::documentrootdir{"drupalgitdir_${name}":
......@@ -122,7 +129,7 @@ define webhosting::php::drupal(
documentroot => $documentroot,
filename => '.git',
thedomain => $name,
owner => $name,
owner => $real_uid_name,
group => 'root',
mode => 400,
}
......@@ -140,25 +147,25 @@ define webhosting::php::drupal(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Drupal[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
}
default: {
Apache::Vhost::Php::Drupal[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::gallery2(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -55,9 +56,15 @@ define webhosting::php::gallery2(
$config_webwriteable = false,
$manage_directories = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -143,25 +150,25 @@ define webhosting::php::gallery2(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Gallery2[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
}
default: {
Apache::Vhost::Php::Gallery2[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::joomla(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -55,9 +56,15 @@ define webhosting::php::joomla(
$config_webwriteable = false,
$manage_directories = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -111,8 +118,8 @@ define webhosting::php::joomla(
ensure => $ensure,
git_repo => $git_repo,
projectroot => $documentroot,
cloneddir_user => $name,
cloneddir_group => $name,
cloneddir_user => $real_uid_name,
cloneddir_group => $real_uid_name,
before => Apache::Vhost::Php::Joomla[$name],
}
apache::vhost::file::documentrootdir{"joomlagitdir_${name}":
......@@ -120,7 +127,7 @@ define webhosting::php::joomla(
documentroot => $documentroot,
filename => '.git',
thedomain => $name,
owner => $name,
owner => $real_uid_name,
group => 'root',
mode => 400,
}
......@@ -138,25 +145,25 @@ define webhosting::php::joomla(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Joomla[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
}
default: {
Apache::Vhost::Php::Joomla[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::mediawiki(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -63,9 +64,15 @@ define webhosting::php::mediawiki(
$language = 'de',
$hashed_upload_dir = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -133,24 +140,24 @@ define webhosting::php::mediawiki(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Mediawiki[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
Mediawiki::Instance[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
documentroot_mode => 0640,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
} else {
Apache::Vhost::Php::Mediawiki[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
Mediawiki::Instance[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::silverstripe(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -55,9 +56,15 @@ define webhosting::php::silverstripe(
$config_webwriteable = false,
$manage_directories = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -111,8 +118,8 @@ define webhosting::php::silverstripe(
ensure => $ensure,
git_repo => $git_repo,
projectroot => $documentroot,
cloneddir_user => $name,
cloneddir_group => $name,
cloneddir_user => $real_uid_name,
cloneddir_group => $real_uid_name,
before => Apache::Vhost::Php::Silverstripe[$name],
}
apache::vhost::file::documentrootdir{"silverstripegitdir_${name}":
......@@ -120,7 +127,7 @@ define webhosting::php::silverstripe(
documentroot => $documentroot,
filename => '.git',
thedomain => $name,
owner => $name,
owner => $real_uid_name,
group => 'root',
mode => 400,
}
......@@ -138,25 +145,25 @@ define webhosting::php::silverstripe(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Silverstripe[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
}
default: {
Apache::Vhost::Php::Silverstripe[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::simplemachine(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -58,6 +59,7 @@ define webhosting::php::simplemachine(
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -111,8 +113,8 @@ define webhosting::php::simplemachine(
ensure => $ensure,
git_repo => $git_repo,
projectroot => $documentroot,
cloneddir_user => $name,
cloneddir_group => $name,
cloneddir_user => $real_uid_name,
cloneddir_group => $real_uid_name,
before => Apache::Vhost::Php::Simplemachine[$name],
}
apache::vhost::file::documentrootdir{"simplemachinesgitdir_${name}":
......@@ -120,7 +122,7 @@ define webhosting::php::simplemachine(
documentroot => $documentroot,
filename => '.git',
thedomain => $name,
owner => $name,
owner => $real_uid_name,
group => 'root',
mode => 400,
}
......@@ -137,24 +139,24 @@ define webhosting::php::simplemachine(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Simplemachine[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
} else {
Apache::Vhost::Php::Simplemachine[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
Git::Clone["git_clone_$name"]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::spip(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -51,9 +52,15 @@ define webhosting::php::spip(
$nagios_check_code = 'OK',
$mod_security = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name
} else {
$real_uid_name = $uid_name
}
webhosting::common{$name:
ensure => $ensure,
uid => $uid,
uid_name => $uid_name,
gid => $gid,
user_provider => $user_provider,
password => $password,
......@@ -110,16 +117,16 @@ define webhosting::php::spip(
$real_run_gid_name = $run_gid_name
}
Apache::Vhost::Php::Spip[$name]{
documentroot_owner => $name,
documentroot_group => $name,
documentroot_owner => $real_uid_name,
documentroot_group => $real_uid_name,
run_uid => $real_run_uid_name,
run_gid => $real_run_gid_name,
require => [ User::Sftp_only["${name}"], User::Managed["${real_run_uid_name}"] ],
require => [ User::Sftp_only["${real_uid_name}"], User::Managed["${real_run_uid_name}"] ],
}
}
default: {
Apache::Vhost::Php::Spip[$name]{
require => User::Sftp_only["${name}"],
require => User::Sftp_only["${real_uid_name}"],
}
}
}
......
......@@ -20,6 +20,7 @@
define webhosting::php::typo3(
$ensure = present,
$uid = 'absent',
$uid_name = 'absent',
$gid = 'uid',
$user_provider = 'local',
$password = 'absent',
......@@ -55,9 +56,15 @@ define webhosting::php::typo3(
$config_webwriteable = false,
$manage_directories = true
){
if ($uid_name == 'absent'){
$real_uid_name = $name