saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.15k stars 5.47k forks source link

[Feature request] saltutil.sync_modules for custom modules that placed in an archieve (.zip or .egg) #18704

Closed billcchung closed 7 years ago

billcchung commented 9 years ago

I have some 3rd party lib that placed in _modules/ and _states/, but I probably wont or rarely touch it. It's kinda annoying to see a long list when I sync them or run cp.list_minon, so I tried to get rid of it by archiving the lib. But _sync in saltutil (https://github.com/saltstack/salt/blob/develop/salt/modules/saltutil.py#L102) only sync .py, .pyx, and .so files.

Can we have it to include .zip files? Any concern about that?

basepi commented 9 years ago

I guess I'm confused -- why do you want the .zip file to be synced to the minion? The minion can't make use of a .zip file. If you just want to get a .zip file down to the minion, you should use the file.managed state.

billcchung commented 9 years ago

We can import modules inside zip files, https://docs.python.org/2/library/zipimport.html, and python eggs are essentially zip files that we can import them as long as PYTHONPATH points to them.

I thought the builtin modules are also placed in a zip file on Windows platforms? (please correct me if my memory is wrong.)

So if I'd like to use 3rd party libraries that are not included in salt, I can have those zip/eggs placed in custom modules directory and sync them to minions, of course I still can unarchive them so the current syncing mechanism will pick them up, but that'll be a long list when I sync them or when I check minion files.

It's not really a big issue nor the enhancement tho, just hoping there is a way to get rid of the long list of files, and the code changes need to go into minions....so I cant just modify saltutil.py in master to make it happen.

basepi commented 9 years ago

I am unsure of whether we use this method on the Windows version of salt -- my knowledge there is very thin. Perhaps @UtahDave can comment.

Let me make sure I understand your issue -- you don't want them in a zip file for performance reasons, but rather just to make the list of things smaller when it syncs? We may be able to solve this problem by just creating an outputter which shows much less output.

Then again, I don't really have a problem with syncing zips, especially if that's how eggs work.

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.