Initial version of samba module.
This commit is contained in:
parent
610f33e506
commit
4a5e98f558
2 changed files with 62 additions and 0 deletions
0
samba/files/lmhosts
Normal file
0
samba/files/lmhosts
Normal file
62
samba/manifests/init.pp
Normal file
62
samba/manifests/init.pp
Normal file
|
@ -0,0 +1,62 @@
|
|||
# Install samba server.
|
||||
#
|
||||
class samba::server {
|
||||
|
||||
package { "samba":
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
service { "smb":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
require => File["/etc/samba/smb.conf"],
|
||||
}
|
||||
|
||||
file { "/etc/samba/smb.conf":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/samba/smb.conf.${fqdn}",
|
||||
"puppet:///files/samba/smb.conf", ],
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => Package["samba"],
|
||||
}
|
||||
|
||||
file { "/etc/samba/lmhosts":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/samba/lmhosts.${fqdn}",
|
||||
"puppet:///files/samba/lmhosts",
|
||||
"puppet:///samba/lmhosts", ],
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => Package["samba"],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Join samba server into domain.
|
||||
#
|
||||
# === Global variables
|
||||
#
|
||||
# $samba_join_user:
|
||||
# Username to use when joining domain.
|
||||
#
|
||||
# $samba_join_pass:
|
||||
# Password to use when joining domain.
|
||||
#
|
||||
class samba::domainmember {
|
||||
|
||||
include samba::server
|
||||
|
||||
exec { "net join":
|
||||
command => "net join -U ${samba_join_user}%'${samba_join_pass}'",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
onlyif => "rpcclient localhost -c 'srvinfo' -U root%'' 2>&1 | grep 'NT_STATUS_CANT_ACCESS_DOMAIN_INFO'",
|
||||
require => Service["smb"],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue