Cookbooks
samba
documentation
Samba Share

samba_share

Creates shares for use with Samba

Properties

NameTypeDefaultDescription
share_nameStringThe name of the share
commentStringComment string to associate with the new share
pathStringPath to directory to share
valid_usersStringA string of allowed users
force_groupStringForce ownership of files on the share to specified group
force_userStringForce ownership of files on the share to specified user
browseabletrue, falsetrueControls whether this share is seen in the list of available shares in a net view and in the browse list
guest_oktrue, falsefalseAllow anoymous access to the share
printableStringfalseIf set to yes, then clients may open, write to and submit spool files on the directory specified for the service
write_list,ArrayAn array of Unix users allowed to write to the share
create_maskString'0744'Create mask for directory
directory_mask,String'0755'Mask for directory
read_onlytrue, falsefalseWhether files on the share are writeable
create_directorytrue, falsetrueWhether to create the new share directory on disk
optionsHash{}A hash of extra options to pass to the configuration file
config_fileString'/opt/local/etc/samba/smb.conf' or '/etc/samba/smb.conf'Path to the samba configuration file

Examples

samba_share 'company-x' do
  comment 'Shared fiels for company X'
  guest_ok false
  write_list %w(dave bob)
  read_only false
  valid_users 'dave bob'
  options  {
    'inherit permissions' => true
  }
  path '/srv/company_x'
end