librarian-puppet icon indicating copy to clipboard operation
librarian-puppet copied to clipboard

Feature Request: only install files necessary for Puppet to function

Open stefanbethke opened this issue 7 years ago • 3 comments

Our modules contain a lot of infrastructure for testing and similar purposes; they are not needed when Puppet is using the module.

When using kitchen-puppet, all these files are copied into the target machine, which takes a significant amount of time.

A new config option --slim would only make the files and directories available that are necessary for Puppet to function (see https://puppet.com/docs/puppet/5.3/modules_fundamentals.html#module-layout)

stefanbethke avatar Jan 17 '18 13:01 stefanbethke

I feel like this shouldn't be solved here but rather at publishing layer. https://puppet.com/docs/puppet/5.0/modules_publishing.html#excluding-files-from-the-package is IMHO the road to go. That way you end up with small modules on the forge. I haven't looked at git checkouts and we probably don't do anything there. Using the same logic (either reuse this from puppet or implement it ourselves) would make sense to me.

ekohl avatar Jan 17 '18 13:01 ekohl

Unfortunately we can't force anyone to publish their modules in this manner onto the forge, even official modules contain things like spec files. In addition to this I personally don't use or want a forge for my own modules, I check them out directly from git.

But I also don't like the idea of including a --slim parameter with hardcoded defaults. A configurable file with a list of inclusions would be better because I can imagine some use cases where additional folders that aren't in the module layout list would be useful.

This could also be tackled in the kitchen-puppet vagrant provisioner. In fact I think this is also a better place to make the change which was originally proposed.

joekohlsdorf avatar Jan 26 '18 22:01 joekohlsdorf

@stefanbethke I just checked kitchen-puppet code and found that the functionality to exclude module paths from being synced to the VM already exists. The configuration option is named ignored_paths_from_root.

joekohlsdorf avatar Jan 28 '18 03:01 joekohlsdorf