salt icon indicating copy to clipboard operation
salt copied to clipboard

Does saltstack support a masterless windows minion.

Open emmellee opened this issue 13 years ago • 12 comments

I have repeatedly tried, without success, to use saltstack in my *nix-less, git-less windows environment. Has anyone been successful in running a windows standalone minion? I've even updated to the latest development version and like the others it complains about the repo:

IOError: [Errno 22] invalid mode ('r') or filename: '' [ERROR ] Unable to cache file "salt://win/repo/winrepo.p" from env "base". [ERROR ] Not able to read repo file [ERROR ] [Errno 22] invalid mode ('r') or filename: '' Traceback (most recent call last): File "C:\salt\salt-0.16.0.win32\salt-0.16.0-py2.7.egg\salt\modules\win_pkg.py" , line 671, in get_repo_data with salt.utils.fopen(cached_repo, 'r') as repofile: File "C:\salt\salt-0.16.0.win32\salt-0.16.0-py2.7.egg\salt\utils__init__.py", line 822, in fopen fhandle = open(_args, *_kwargs) IOError: [Errno 22] invalid mode ('r') or filename: ''

How may I configure my windows minion to use its local filesystem as its repo for packages and whatnot?

Should I even try to use saltstack for my all-windows server environment?

emmellee avatar Jul 16 '13 16:07 emmellee

Heh, you're the second person today to ask that! It's being discussed here: https://groups.google.com/forum/#!topic/salt-users/zAnuVNQFTAY Can you post your results there to help in the ongoing conversation, please?

basepi avatar Jul 16 '13 16:07 basepi

I haven't even tried masterless salt on Windows yet. I'll test it today On Jul 16, 2013 10:38 AM, "emmellee" [email protected] wrote:

I have repeatedly tried, without success, to use saltstack in my *nix-less, git-less windows environment. Has anyone been successful in running a windows standalone minion? I've even updated to the latest development version and like the others it complains about the repo:

IOError: [Errno 22] invalid mode ('r') or filename: '' [ERROR ] Unable to cache file "salt://win/repo/winrepo.p" from env "base". [ERROR ] Not able to read repo file [ERROR ] [Errno 22] invalid mode ('r') or filename: '' Traceback (most recent call last): File "C:\salt\salt-0.16.0.win32\salt-0.16.0-py2.7.egg\salt\modules\win_pkg.py" , line 671, in get_repo_data with salt.utils.fopen(cached_repo, 'r') as repofile: File "C:\salt\salt-0.16.0.win32\salt-0.16.0-py2.7.egg\salt\utils__init__.py", line 822, in fopen fhandle = open(_args, *_kwargs) IOError: [Errno 22] invalid mode ('r') or filename: ''

How may I configure my windows minion to use its local filesystem as its repo for packages and whatnot?

Should I even try to use saltstack for my all-windows server environment?

— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/6180 .

UtahDave avatar Jul 16 '13 16:07 UtahDave

Thanks. Appreciate it, very much. I've been beating my head against the wall and then, thought, maybe no one does this...

emmellee avatar Jul 16 '13 18:07 emmellee

no luck?

emmellee avatar Jul 18 '13 20:07 emmellee

@emmellee what have you done to try to create your repo cache file?

UtahDave avatar Jul 19 '13 02:07 UtahDave

OK, so many of the things on windows will work using salt-call. Currently, though, the Salt Windows package manager was built with the idea that the minion was being controlled by the master. There aren't routines built yet to have a standalone minion manage it's own windows software repo. This is an oversight and will need to be corrected.

UtahDave avatar Jul 19 '13 02:07 UtahDave

is this something in the works or rather down the line. i ask because i have five new servers and i wanted to set them up the 'right' way. Don't know how long mgt will let me wait...

emmellee avatar Jul 19 '13 22:07 emmellee

I'm not going to be able to get to it this week. I'd suggest using a Linux master for the time being. You could even run your master in hyperv, if needed On Jul 19, 2013 4:32 PM, "emmellee" [email protected] wrote:

is this something in the works or rather down the line. i ask because i have five new servers and i wanted to set them up the 'right' way. Don't know how long mgt will let me wait...

— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/6180#issuecomment-21281480 .

UtahDave avatar Jul 20 '13 01:07 UtahDave

Thanks. In a normal world, I would, but I work for the strange world of the DoD. And while I have privileges on the windows VMs, I have no access to any linux servers. Let alone, my trying to introduce zeromq to a security czar. Masterless seemed perfect in that respect. Thought I'd get my foot in the door that way. I know the DoD uses puppet, but I know of no agency using salt yet. We're a bit frightened of the unfamiliar. I have no experience with either, but I was swayed by the testimonials that salt would be easier to administer.

emmellee avatar Jul 22 '13 01:07 emmellee

:-) I worked for the DoD before SaltStack, so I understand.

To get the Windows repo working I think I need to write a module for managing the repo, similar to the runner on the master. Let me see what I can put together tonight On Jul 21, 2013 6:02 PM, "emmellee" [email protected] wrote:

Thanks. In a normal world, I would, but I work for the strange world of the DoD. And while I have privileges on the windows VMs, I have no access to any linux servers. Let alone, my trying to introduce zeromq to a security czar. Masterless seemed perfect in that respect. Thought I'd get my foot in the door that way. I know the DoD uses puppet, but I know of no agency using salt yet. We're a bit frightened of the unfamiliar. I have no experience with either, but I was swayed by the testimonials that salt would be easier to administer.

— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/6180#issuecomment-21320502 .

UtahDave avatar Jul 22 '13 01:07 UtahDave

OK, I've gotten this to work, @emmellee.

In order to manage a Windows package repo on a standalone minion I had to create a regular module that mimics what the winrepo runner does.

Here's the commit with the addition: https://github.com/saltstack/salt/pull/6273

If you look at the comment at the top of the file you'll see 3 items that need to be set in your minion config. Once those are set you can place your Windows package files in your 'win_repo' directory. You can use the contents of the salt-winrepo git repository there for a starting point.

Then execute salt-call winrepo.genrepo -c c:\salt\conf

Then you should be able to use the Windows Salt pkg manager to install software. For example, if you have the audacity package file from salt-winrepo in your 'win_repo' you should be able to successfully execute the following:

salt-call -c c:\salt\conf pkg.install audacity

Can you test this, @emmellee?

UtahDave avatar Jul 23 '13 08:07 UtahDave

This should be fixed by #6273

I'm going to close this issue. If you are still seeing problems, please feel free to reopen.

Thanks for the idea!

UtahDave avatar Jul 23 '13 23:07 UtahDave