SMBFS Share in Finder Sidebar?

38 views
Skip to first unread message

mta...@lygos.com

unread,
Nov 27, 2017, 4:31:22 PM11/27/17
to Puppet Users
Hi,

I have created an SMB share that I can manually mount through Finder -> Go -> Connect to Server.
It shows up under /Volumes in the Finder Sidebar correctly.  The OS usefully sets the mount point owned by
me and under the group 'staff' with mount point permissions 0755.

Using the mount module I can mount this same share, but I am unable to mount it under /Volumes, or get 
it to be in group 'staff' instead of 'wheel', or to show up in the Finder Sidebar.  Here is my mount invocation:

   file { '/Users/Shared/mnt':
      ensure => 'directory',
   }
   mount {'/Users/Shared/mnt':
       name     => '/Users/Shared/mnt',
       device   => '//[USER]:[PASSWORD]@[SMB HOST]/[SMB SHARE]',
       atboot   => 'true',
       options  => '-d=755',
       ensure   => 'mounted',
       fstype   => 'smbfs',
       require  => File['/Users/Shared/mnt'],
       notify   => Exec['fix_mount_perms'],
   }
   exec { 'fix_mount_perms':
       command          => '/bin/chmod 0755 /Users/Shared/mnt && /usr/bin/chgrp staff /Users/Shared/mnt',
       refreshonly     => true
   }

I'd love to know the correct mount methodology that simulates what my Mac (10.13.1) is doing natively.

Thanks!

Marshall

mta...@lygos.com

unread,
Nov 28, 2017, 7:42:14 PM11/28/17
to Puppet Users
I tried *many* different invocations of the mount module from w/i my manifest to no avail. 
However, I got it working by writing an Applescript one-liner:

tell application "Finder" to open location "smb://[USER]:[PASSWORD]@[SMB HOST]/[SMB SHARE]"


The Mac node downloads this script, executes it, et voila(!) an SMBFS share that you can find in the Finder Sidebar. These are my manifest mods:

file { '/usr/local/sbin/mac_mount_[SHARENAME].scpt': ensure => file, source => 'puppet:///modules/mac/mac_mount_[SHARENAME].scpt', owner => 'root', group => 'wheel', mode => '0755', } exec {'Mount smbfs share': command => '/usr/bin/osascript /usr/local/sbin/mac_mount_[SHARENAME].scpt', }
Hope that helps someone in need.

Cheers,

Marshall

Reply all
Reply to author
Forward
0 new messages