Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom permissions of local mount point #3

Open
uoe-pjackson opened this issue Jan 31, 2022 · 0 comments
Open

Allow custom permissions of local mount point #3

uoe-pjackson opened this issue Jan 31, 2022 · 0 comments

Comments

@uoe-pjackson
Copy link

I create a client mount with puppet code such as:

class profiles::example {
  $sftp_storage_private_key = lookup('profiles::example::sftp_storage_private_key')

  class { '::sshfs::client':
    local_mount_point        => '/mnt/example',
    manage_private_key       => true, 
    private_key_path         => '/root/credentials/sshfs.key',
    remote_share_host        => 'server.example.com',
    remote_share_path        => '/',
    remote_share_user_name   => 'example',
    private_key              => $sftp_storage_private_key
  }
}

First puppet run completes without error.

Notice: /Stage[main]/Sshfs::Client::Mount/File[/mnt/example]/ensure: created (corrective)
Notice: /Stage[main]/Sshfs::Client::Mount/Mount[/mnt/example]/ensure: ensure changed 'unmounted' to 'mounted' (corrective)
Info: /Stage[main]/Sshfs::Client::Mount/Mount[/mnt/example]: Scheduling refresh of Mount[/mnt/example]
Info: Mount[/mnt/example](provider=parsed): Remounting
Notice: /Stage[main]/Sshfs::Client::Mount/Mount[/mnt/example]: Triggered 'refresh' from 1 event
Info: /Stage[main]/Sshfs::Client::Mount/Mount[/mnt/example]: Scheduling refresh of Mount[/remote/apps-sftpxfr]

If the remote sshfs share has filesystem permission of 755 after the initial successful puppet run the next and all subsequent puppet runs report an error:

Error: failed to set mode 0755 on /remote/apps-sftpxfr: Permission denied @ apply2files - /remote/apps-sftpxfr
Error: /Stage[main]/Sshfs::Client::Mount/File[/remote/apps-sftpxfr]/mode: change from '0755' to '0775' failed: failed to set mode 0755 on /remote/apps-sftpxfr: Permission denied @ apply2files - /remote/apps-sftpxfr (corrective)

I believe that this is due to the hardcoded permissions mode of 0775 in manifests/client/mount.pp

  file { $sshfs::client::local_mount_point:
    ensure => directory,
    owner  => $sshfs::client::local_share_user_name,
    group  => $sshfs::client::local_share_group_name,
    mode   => '0775',
  }

I'll create a Pull request to change this to a variable (defaulting to 0775)

Thanks!

uoe-pjackson added a commit to uoe-pjackson/wwkimball-sshfs that referenced this issue Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant