On Mon, Aug 05, 2013 at 09:29:06PM -0500, Pablo Carranza wrote:
> Has anyone taken a stab at putting together a Puppet module to install
> and/or manage SOGo?
>
> I'm trying to put one together, from scratch, and it's been a loooong and
> tedious process, thus far.
It's probably not directly applicable to other sites, but this is what we
use on out sogo backends:
sogo/manifests/init.pp
----8<---8<----8<-----8<----8<-----8<----8<----8<----8<----8<----8<---
class sogo {
realize(
User["sogo"],
Group["sogo"],
)
$packages = [ "sogo", "sope49-gdl1-postgresql", "httpd", "sogo-tool" ]
package { $packages:
ensure => installed,
}
$sogodirs = [ "/home/sogo", "/home/sogo/GNUstep/",
"/home/sogo/GNUstep/Defaults/", "/var/log/sogo", "/var/spool/sogo" ]
file { $sogodirs:
ensure => "directory",
owner => sogo,
group => sogo,
mode => 755,
}
file { "/var/run/sogo" :
ensure => "directory",
owner => sogo,
group => sogo,
mode => 700,
}
file { "/home/sogo/GNUstep/Defaults/.GNUstepDefaults":
owner => sogo,
group => sogo,
mode => 600,
source => [
"puppet:///modules/sogo/GNUstepDefaults-$fqdn",
"puppet:///modules/sogo/GNUstepDefaults",
],
notify => Service["sogod"],
}
file { "/etc/sysconfig/sogo":
owner => root,
group => root,
mode => 444,
source => [
"puppet:///modules/sogo/sysconfig_sogo-$fqdn",
"puppet:///modules/sogo/sysconfig_sogo",
],
notify => Service["sogod"],
}
# this kills sogod's that's been consuming more than 15m cputime:
file { "/usr/local/sbin/sogo-watchdog.sh":
owner => root,
group => root,
mode => 555,
source => [
"puppet:///modules/sogo/sogo-watchdog.sh-$fqdn",
"puppet:///modules/sogo/sogo-watchdog.sh",
],
}
file { "/etc/cron.d/sogo-watchdog.cron":
owner => root,
group => root,
mode => 444,
source => [
"puppet:///modules/sogo/sogo-watchdog.cron-$fqdn",
"puppet:///modules/sogo/sogo-watchdog.cron",
],
}
file { "/etc/httpd/conf.d/01-SOGo-local.conf":
owner => root,
group => root,
mode => 444,
source => [
"puppet:///modules/sogo/SOGo-local.conf-$fqdn",
"puppet:///modules/sogo/SOGo-local.conf",
],
notify => Service["httpd"],
}
file { "/etc/httpd/conf.d/02-SOGo-shared.conf":
owner => root,
group => root,
mode => 444,
source => [
"puppet:///modules/sogo/SOGo-shared.conf-$fqdn",
"puppet:///modules/sogo/SOGo-shared.conf",
],
notify => Service["httpd"],
}
file { "/etc/httpd/conf.d/SOGo.conf":
owner => root,
group => root,
mode => 444,
source => [
"puppet:///modules/sogo/SOGo.conf-$fqdn",
"puppet:///modules/sogo/SOGo.conf",
],
notify => Service["httpd"],
}
file { "/etc/httpd/conf.d/00-apache-server-status.conf":
owner => root,
group => root,
mode => 444,
source => [
"puppet:///modules/sogo/00-apache-server-status.conf-$fqdn",
"puppet:///modules/sogo/00-apache-server-status.conf",
],
notify => Service["httpd"],
}
service { "httpd":
ensure => true,
enable => true,
require => [ File["/etc/httpd/conf.d/SOGo.conf"], Package["httpd"], ],
}
service { "sogod":
ensure => true,
enable => true,
start => "/usr/local/sbin/sogo-services.sh start",
stop => "/usr/local/sbin/sogo-services.sh stop",
require => [ File["/home/sogo/GNUstep/Defaults/.GNUstepDefaults"],
Package["sogo"], Package["sope49-gdl1-postgresql"],
File['/usr/local/sbin/sogo-services.sh'], ],
}
# Script to make sure all sogod's are dead before starting them.. Also
manages keepalived daemon:
file { "/usr/local/sbin/sogo-services.sh":
owner => root,
group => root,
mode => 755,
source => [
"puppet:///modules/sogo/sogo-services.sh-$fqdn",
"puppet:///modules/sogo/sogo-services.sh",
],
}
}
----8<---8<----8<-----8<----8<-----8<----8<----8<----8<----8<----8<---
sogo/manifests/skin.pp
----8<---8<----8<-----8<----8<-----8<----8<----8<----8<----8<----8<---
class sogo::skin inherits sogo {
file { "/usr/lib64/GNUstep/SOGo/WebServerResources/altibox.js":
owner => root,
group => root,
mode => 444,
source => "puppet:///modules/sogo/skin/WebServerResources/altibox.js",
require => Package["sogo"],
}
file { "/usr/lib64/GNUstep/SOGo/WebServerResources/iefixes.css":
owner => root,
group => root,
mode => 444,
source => "puppet:///modules/sogo/skin/WebServerResources/iefixes.css",
require => Package["sogo"],
}
file { "/usr/lib64/GNUstep/SOGo/WebServerResources/altibox.css":
owner => root,
group => root,
mode => 444,
source => "puppet:///modules/sogo/skin/WebServerResources/altibox.css",
require => Package["sogo"],
}
file { "/usr/lib64/GNUstep/SOGo/WebServerResources/altibox":
ensure => "directory",
owner => root,
group => root,
mode => 755,
recurse => true,
purge => true,
source => "puppet:///modules/sogo/skin/WebServerResources/altibox",
require => Package["sogo"],
}
file { "/home/sogo/GNUstep/Library":
ensure => "directory",
owner => root,
group => root,
mode => 755,
recurse => true,
purge => true,
source => "puppet:///modules/sogo/skin/Library",
require => Package["sogo"],
notify => Service["sogod"],
}
file { "/var/www/partnerlogos":
ensure => "directory",
owner => root,
group => root,
mode => 755,
recurse => true,
purge => true,
source => "puppet:///modules/sogo/skin/partnerlogo",
require => Package["sogo"],
}
}
----8<---8<----8<-----8<----8<-----8<----8<----8<----8<----8<----8<---
-jf
--
[email protected]
https://inverse.ca/sogo/lists