salt icon indicating copy to clipboard operation
salt copied to clipboard

Windows minions assume winrepo cache file location regardless of win_repo_mastercachefile value

Open joshmule opened this issue 12 years ago • 11 comments

Windows minions seem to assume winrepo cache file location regardless of the win_repo_mastercachefile: setting on the master side.

Unless win_repo_mastercachefile: is set to something that translates to salt://win/repo/winrepo.p , the Windows minion will complain that salt://win/repo/winrepo.p can't be found. Setting win_repo_mastercachefile: to another file or directory/file that is within salt://win/ doesn't work either, even though the minion can clearly access that location.

The minion conf file contains the default contents of:

# win_repo_cachefile: 'salt://win/repo/winrepo.p'

... but is clearly insisting on using that commented out default regardless of the win_repo_mastercachefile: location set on the master side.

Is this a bug?

Minion version: salt-2014.1.10.win-amd64
Master version: 2014.1.7+ds-1trusty1

joshmule avatar Sep 18 '14 16:09 joshmule

Have you tried updating the win_repo_cachefile in your minion config to match where in your master's file_roots the cache file exists? The master config doesn't modify or override the minion config.

so if in your master config you have

win_repo_mastercachefile: /srv/salt/new/directory/winrepo.p

Then in your minion config you'd need to have:

win_repo_cachefile: 'salt://new/directory/winrepo.p'

UtahDave avatar Sep 18 '14 19:09 UtahDave

I've not tried that, but I think that misses the point of the minions configuration I was attempting to make.... it doesn't have win_repo_cachefile set.... it is commented out. As such, why is the minion still insisting on using the undeclared win_repo_cachefile: over the explicitly specified win_repo_mastercachefile: setting?

joshmule avatar Sep 18 '14 22:09 joshmule

@joshmule if an option is commented out in the config file, then Salt will use the default value for that config option.

I'm a bit confused. You say that the win_repo_cachefile option is commented out, and then you say the win_repo_cachefile setting is explicitly set. Can you clarify?

UtahDave avatar Sep 19 '14 22:09 UtahDave

Sorry, just edited to clarify. win_repo_mastercachefile:, on the master side, is the only thing explicitly set.

joshmule avatar Sep 19 '14 22:09 joshmule

OK, thanks for clarifying that!

So the win_repo_mastercachefile just tells the master where on the filesystem to put the cachefile. You still have to tell the minion where to find the cache file. Any option that is commented out will use the default value.

UtahDave avatar Sep 19 '14 22:09 UtahDave

Can the minion find the cachefile correctly when you set win_repo_cachefile in the minion config to look where you moved it to on the master?

UtahDave avatar Sep 19 '14 22:09 UtahDave

Don't know, will need to try that and get back to you. Seems like a bummer to have to set the location on both sides... would be nice for win_repo_mastercachefile: on the master side to do all the magic for the client's understanding of the location too.

joshmule avatar Sep 19 '14 22:09 joshmule

That's a fair point. Maybe we could add a feature to have the minion fall back to that value if it is available to the minion and the win_repo_cachefile location isn't available.

UtahDave avatar Sep 19 '14 23:09 UtahDave

Would also be super easy to implement, since minions have all the master opts in pillar.

basepi avatar Sep 25 '14 19:09 basepi

Related: #20526 - winrepo.genrepo runner joins 2 absolute paths for writing the winrepo cache file

eliasp avatar Feb 16 '15 17:02 eliasp

I'm going to close this issue since Salt is working as designed at the moment. I'm considering removing the option to specify a non-default location and putting it in the file_roots under _winrepo, or something.

UtahDave avatar Jun 29 '15 21:06 UtahDave