puppetlabs / r10k

Smarter Puppet deployment
Other
799 stars 354 forks source link

r10k saves modules to moduledir with diffrent permissions depending on what mod method used #1029

Closed freibuis closed 3 years ago

freibuis commented 4 years ago

Describe the Bug

Currently when doing a r10k puppetfile install the permission written on Unix systems depends on where the module is being pulled from.

Example

mod 'petems-hiera_vault', '0.4.0'

if run by gitlab-runner as the user

drwxr-xr-x  5 gitlab-runner gitlab-runner 4096 Mar  1 01:25 hiera_vault

but if used from git source

mod 'hiera_vault',   :git => 'https://github.com/petems/petems-hiera_vault'

the permissions are based on the default permissions placed on the parent directory

example

drwxrwsr-x+  5 gitlab-runner puppet-server 4096 Mar  2 03:25 hiera_vault

what this causes is .. if the git repo gets updated then when r10k puppetfile install is invoked the WARN message is raised code is not deployed

WARN     -> Skipping /etc/puppetlabs/code/modules/hiera_vault due to local modifications

Expected Behavior

Permissions should either be the user who invoked the r10k puppetfile install or by the default permissions set on the directory. not either

Steps to Reproduce

To reproduce this you will need to create a group then set some defaults permissions on that directory.. preferably not the same group that the user is I used a group called puppet-server in my examples above. then add one module to your Puppetfile to target the puppet forge then another to a target git repo.

Environment

r10k 3.4.0

Additional Context

I believe the issue is related to how the git process is spawned.

github-actions[bot] commented 3 years ago

This issue has been marked stale because it has had no activity for 60 days. The Puppet Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.