Added OpenBSD support for sasl module
This commit is contained in:
parent
77d3f662bc
commit
8196bc7c40
1 changed files with 64 additions and 23 deletions
|
@ -8,10 +8,14 @@ class sasl::client {
|
||||||
"ubuntu" => "sasl2-bin",
|
"ubuntu" => "sasl2-bin",
|
||||||
default => "cyrus-sasl",
|
default => "cyrus-sasl",
|
||||||
},
|
},
|
||||||
|
flavor => $::operatingsystem ? {
|
||||||
|
"openbsd" => "ldap",
|
||||||
|
default => undef,
|
||||||
|
},
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
}
|
}
|
||||||
|
|
||||||
if $kerberos_realm {
|
if $kerberos_realm and $::operatingsystem != "OpenBSD" {
|
||||||
package { "cyrus-sasl-gssapi":
|
package { "cyrus-sasl-gssapi":
|
||||||
name => $::operatingsystem ? {
|
name => $::operatingsystem ? {
|
||||||
"ubuntu" => "libsasl2-modules-gssapi-mit",
|
"ubuntu" => "libsasl2-modules-gssapi-mit",
|
||||||
|
@ -32,7 +36,7 @@ class sasl::client {
|
||||||
# default. Supported mechanisms include pam, ldap and kerberos5.
|
# default. Supported mechanisms include pam, ldap and kerberos5.
|
||||||
#
|
#
|
||||||
# For ldap authentication, see ldap::client for required global variables.
|
# For ldap authentication, see ldap::client for required global variables.
|
||||||
#
|
#
|
||||||
class sasl::saslauthd {
|
class sasl::saslauthd {
|
||||||
|
|
||||||
require sasl::client
|
require sasl::client
|
||||||
|
@ -41,27 +45,48 @@ class sasl::saslauthd {
|
||||||
"","pam": { }
|
"","pam": { }
|
||||||
"ldap": {
|
"ldap": {
|
||||||
include ldap::client
|
include ldap::client
|
||||||
|
|
||||||
augeas { "set-saslauthd-mech":
|
case $::operatingsystem {
|
||||||
context => "/files/etc/sysconfig/saslauthd",
|
"centos","fedora","redhat": {
|
||||||
changes => "set MECH ldap",
|
augeas { "set-saslauthd-mech":
|
||||||
notify => Service["saslauthd"],
|
context => "/files/etc/sysconfig/saslauthd",
|
||||||
|
changes => "set MECH ldap",
|
||||||
|
notify => Service["saslauthd"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"openbsd": {
|
||||||
|
Service["saslauthd"] {
|
||||||
|
start => "/usr/local/sbin/saslauthd -a ldap",
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/etc/saslauthd.conf":
|
file { "/etc/saslauthd.conf":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => 0644,
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
content => template("sasl/saslauthd.conf.ldap.erb"),
|
content => template("sasl/saslauthd.conf.ldap.erb"),
|
||||||
notify => Service["saslauthd"],
|
notify => Service["saslauthd"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"kerberos5": {
|
"kerberos5": {
|
||||||
augeas { "set-saslauthd-mech":
|
case $::operatingsystem {
|
||||||
context => "/files/etc/sysconfig/saslauthd",
|
"centos","fedora","redhat": {
|
||||||
changes => "set MECH kerberos5",
|
augeas { "set-saslauthd-mech":
|
||||||
notify => Service["saslauthd"],
|
context => "/files/etc/sysconfig/saslauthd",
|
||||||
|
changes => "set MECH kerberos5",
|
||||||
|
notify => Service["saslauthd"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"openbsd": {
|
||||||
|
Service["saslauthd"] {
|
||||||
|
start => "/usr/local/sbin/saslauthd -a kerberos5",
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
@ -78,13 +103,16 @@ class sasl::saslauthd {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
require => Exec["generate-sasldb2"],
|
require => Exec["generate-sasldb2"],
|
||||||
before => Service["saslauthd"],
|
before => Service["saslauthd"],
|
||||||
}
|
}
|
||||||
exec { "generate-sasldb2":
|
exec { "generate-sasldb2":
|
||||||
command => "saslpasswd2 -d foobar ; true",
|
command => "saslpasswd2 -d foobar ; true",
|
||||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
|
||||||
creates => "/etc/sasldb2",
|
creates => "/etc/sasldb2",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,10 +132,20 @@ class sasl::saslauthd {
|
||||||
#
|
#
|
||||||
define sasl::saslauthd::service() {
|
define sasl::saslauthd::service() {
|
||||||
|
|
||||||
case $architecture {
|
case $::operatingsystem {
|
||||||
"i386": { $libdir = "/usr/lib/sasl2" }
|
"centos","fedora","redhat": {
|
||||||
"x86_64": { $libdir = "/usr/lib64/sasl2" }
|
case $::architecture {
|
||||||
default: { fail("Unknown architecture ${architecture}") }
|
"i386": { $libdir = "/usr/lib/sasl2" }
|
||||||
|
"x86_64": { $libdir = "/usr/lib64/sasl2" }
|
||||||
|
default: { fail("Unknown architecture ${::architecture}") }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"openbsd": {
|
||||||
|
$libdir = "/usr/local/lib/sasl2"
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
fail("sasl not supported on ${::operatingsystem}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${libdir}/${name}.conf":
|
file { "${libdir}/${name}.conf":
|
||||||
|
@ -118,7 +156,10 @@ define sasl::saslauthd::service() {
|
||||||
"puppet:///modules/sasl/service.conf", ],
|
"puppet:///modules/sasl/service.conf", ],
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
require => Service["saslauthd"],
|
require => Service["saslauthd"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue