Discussion:
[salt-users] Problems with Windows Software Repo
a***@gmail.com
2016-04-26 23:55:06 UTC
Permalink
So I setup the windows software repository using

win_repo: '/salt/states/win/repo-ng'

#

# Location of the master's repo cache file:

win_repo_mastercachefile: 'winrepo.p'

#

# List of git repositories to include with the local repo:

#win_gitrepos:

# - 'https://github.com/saltstack/salt-winrepo-ng.git'


I did the salt-run winrepo.update_git_repos and the salt-run
winrepo.genrepo followed by salt '*' pkg.refresh_db


the first problem I noticed was that the winrepo.p was not getting pushed
down to the client so I made the winrepo.p file into a symbolic link from
the /salt/states/win/repo-ng and then added it to my state which looks like:


c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p:
file.managed:
- source: salt://packages/winrepo.p

WebServerRole:
win_servermanager.installed:
- name: Web-Server

7zip:
pkg.installed:
- pkgs:
- 7zip


when I invoke the salt '*' state.highstate I get the following with the package i want to install returning an error:


----------

ID: c:\scripts

Function: file.directory

Result: True

Comment: Directory c:\scripts is in the correct state

Started: 16:04:28.239000

Duration: 31.0 ms

Changes:

----------

ID: c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p

Function: file.managed

Result: True

Comment: File c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p is in the correct state

Started: 16:04:28.270000

Duration: 63.0 ms

Changes:

----------

ID: WebServerRole

Function: win_servermanager.installed

Name: Web-Server

Result: True

Comment: The feature Web-Server is already installed

Started: 16:04:28.817000

Duration: 2172.0 ms

Changes:

----------

ID: 7zip

Function: pkg.installed

Result: False

Comment: The following packages failed to install/update: 7zip

Started: 16:04:31.458000

Duration: 140.0 ms

Changes:

----------

7zip:

Unable to locate package 7zip


Summary

------------

Succeeded: 3 (changed=1)

Failed: 1

------------

Total states run: 4



my setup is as follows for my states


salt

--states

--base

--development

--pwstest

--box in question is under this one with the above init.sls

--nginx

--otherstate

production
--pws

--nginx

--otherstate



this is what i see if I launch the salt-minion on windows in debug


[DEBUG ] Could not LazyLoad pkg.ex_mod_init
[INFO ] Running state [7zip] at time 16:52:13.711000
[INFO ] Executing state pkg.installed for 7zip
[DEBUG ] Could not LazyLoad pkg.normalize_name
[DEBUG ] Could not LazyLoad pkg.check_db
[INFO ] Caching directory u'win/repo-ng/' for environment 'base'
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not LazyLoad pkg.normalize_name
[ERROR ] Unable to locate package 7zip
[DEBUG ] Could not LazyLoad pkg.hold
[ERROR ] {'7zip': 'Unable to locate package 7zip'}
[DEBUG ] Refreshing modules...
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2016-04-27 17:33:39 UTC
Permalink
FYI I discovered my instance had an old version of the Salt-master 2015.5.8
and updated to now using the 2015.8+ instruction but getting the same issue.
Post by a***@gmail.com
So I setup the windows software repository using
win_repo: '/salt/states/win/repo-ng'
#
win_repo_mastercachefile: 'winrepo.p'
#
# - 'https://github.com/saltstack/salt-winrepo-ng.git'
I did the salt-run winrepo.update_git_repos and the salt-run
winrepo.genrepo followed by salt '*' pkg.refresh_db
the first problem I noticed was that the winrepo.p was not getting pushed
down to the client so I made the winrepo.p file into a symbolic link from
- source: salt://packages/winrepo.p
- name: Web-Server
- 7zip
----------
ID: c:\scripts
Function: file.directory
Result: True
Comment: Directory c:\scripts is in the correct state
Started: 16:04:28.239000
Duration: 31.0 ms
----------
ID: c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p
Function: file.managed
Result: True
Comment: File c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p is in the correct state
Started: 16:04:28.270000
Duration: 63.0 ms
----------
ID: WebServerRole
Function: win_servermanager.installed
Name: Web-Server
Result: True
Comment: The feature Web-Server is already installed
Started: 16:04:28.817000
Duration: 2172.0 ms
----------
ID: 7zip
Function: pkg.installed
Result: False
Comment: The following packages failed to install/update: 7zip
Started: 16:04:31.458000
Duration: 140.0 ms
----------
Unable to locate package 7zip
Summary
------------
Succeeded: 3 (changed=1)
Failed: 1
------------
Total states run: 4
my setup is as follows for my states
salt
--states
--base
--development
--pwstest
--box in question is under this one with the above init.sls
--nginx
--otherstate
production
--pws
--nginx
--otherstate
this is what i see if I launch the salt-minion on windows in debug
[DEBUG ] Could not LazyLoad pkg.ex_mod_init
[INFO ] Running state [7zip] at time 16:52:13.711000
[INFO ] Executing state pkg.installed for 7zip
[DEBUG ] Could not LazyLoad pkg.normalize_name
[DEBUG ] Could not LazyLoad pkg.check_db
[INFO ] Caching directory u'win/repo-ng/' for environment 'base'
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not LazyLoad pkg.normalize_name
[ERROR ] Unable to locate package 7zip
[DEBUG ] Could not LazyLoad pkg.hold
[ERROR ] {'7zip': 'Unable to locate package 7zip'}
[DEBUG ] Refreshing modules...
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shane Lee
2016-04-27 18:13:22 UTC
Permalink
What version is your minion?
Post by a***@gmail.com
So I setup the windows software repository using
win_repo: '/salt/states/win/repo-ng'
#
win_repo_mastercachefile: 'winrepo.p'
#
# - 'https://github.com/saltstack/salt-winrepo-ng.git'
I did the salt-run winrepo.update_git_repos and the salt-run
winrepo.genrepo followed by salt '*' pkg.refresh_db
the first problem I noticed was that the winrepo.p was not getting pushed
down to the client so I made the winrepo.p file into a symbolic link from
- source: salt://packages/winrepo.p
- name: Web-Server
- 7zip
----------
ID: c:\scripts
Function: file.directory
Result: True
Comment: Directory c:\scripts is in the correct state
Started: 16:04:28.239000
Duration: 31.0 ms
----------
ID: c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p
Function: file.managed
Result: True
Comment: File c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p is in the correct state
Started: 16:04:28.270000
Duration: 63.0 ms
----------
ID: WebServerRole
Function: win_servermanager.installed
Name: Web-Server
Result: True
Comment: The feature Web-Server is already installed
Started: 16:04:28.817000
Duration: 2172.0 ms
----------
ID: 7zip
Function: pkg.installed
Result: False
Comment: The following packages failed to install/update: 7zip
Started: 16:04:31.458000
Duration: 140.0 ms
----------
Unable to locate package 7zip
Summary
------------
Succeeded: 3 (changed=1)
Failed: 1
------------
Total states run: 4
my setup is as follows for my states
salt
--states
--base
--development
--pwstest
--box in question is under this one with the above init.sls
--nginx
--otherstate
production
--pws
--nginx
--otherstate
this is what i see if I launch the salt-minion on windows in debug
[DEBUG ] Could not LazyLoad pkg.ex_mod_init
[INFO ] Running state [7zip] at time 16:52:13.711000
[INFO ] Executing state pkg.installed for 7zip
[DEBUG ] Could not LazyLoad pkg.normalize_name
[DEBUG ] Could not LazyLoad pkg.check_db
[INFO ] Caching directory u'win/repo-ng/' for environment 'base'
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not LazyLoad pkg.normalize_name
[ERROR ] Unable to locate package 7zip
[DEBUG ] Could not LazyLoad pkg.hold
[ERROR ] {'7zip': 'Unable to locate package 7zip'}
[DEBUG ] Refreshing modules...
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2016-04-27 19:49:26 UTC
Permalink
Minion is running the 64-bit 2015.8.2 and then I also update the settings
in the master to reflect the new variables as it complained about the
deprecated variables. I should mention as well that my file roots is also
set so that the states live at a custom location. I noticed it said
something about caching the wirepo at base ?
Post by Shane Lee
What version is your minion?
Post by a***@gmail.com
So I setup the windows software repository using
win_repo: '/salt/states/win/repo-ng'
#
win_repo_mastercachefile: 'winrepo.p'
#
# - 'https://github.com/saltstack/salt-winrepo-ng.git'
I did the salt-run winrepo.update_git_repos and the salt-run
winrepo.genrepo followed by salt '*' pkg.refresh_db
the first problem I noticed was that the winrepo.p was not getting pushed
down to the client so I made the winrepo.p file into a symbolic link from
- source: salt://packages/winrepo.p
- name: Web-Server
- 7zip
----------
ID: c:\scripts
Function: file.directory
Result: True
Comment: Directory c:\scripts is in the correct state
Started: 16:04:28.239000
Duration: 31.0 ms
----------
ID: c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p
Function: file.managed
Result: True
Comment: File c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p is in the correct state
Started: 16:04:28.270000
Duration: 63.0 ms
----------
ID: WebServerRole
Function: win_servermanager.installed
Name: Web-Server
Result: True
Comment: The feature Web-Server is already installed
Started: 16:04:28.817000
Duration: 2172.0 ms
----------
ID: 7zip
Function: pkg.installed
Result: False
Comment: The following packages failed to install/update: 7zip
Started: 16:04:31.458000
Duration: 140.0 ms
----------
Unable to locate package 7zip
Summary
------------
Succeeded: 3 (changed=1)
Failed: 1
------------
Total states run: 4
my setup is as follows for my states
salt
--states
--base
--development
--pwstest
--box in question is under this one with the above init.sls
--nginx
--otherstate
production
--pws
--nginx
--otherstate
this is what i see if I launch the salt-minion on windows in debug
[DEBUG ] Could not LazyLoad pkg.ex_mod_init
[INFO ] Running state [7zip] at time 16:52:13.711000
[INFO ] Executing state pkg.installed for 7zip
[DEBUG ] Could not LazyLoad pkg.normalize_name
[DEBUG ] Could not LazyLoad pkg.check_db
[INFO ] Caching directory u'win/repo-ng/' for environment 'base'
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not LazyLoad pkg.normalize_name
[ERROR ] Unable to locate package 7zip
[DEBUG ] Could not LazyLoad pkg.hold
[ERROR ] {'7zip': 'Unable to locate package 7zip'}
[DEBUG ] Refreshing modules...
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2016-04-27 22:33:52 UTC
Permalink
So if I change all the settings and let it accept the defaults /srv/salt
location and gen the repo again I try to test what packages it knows about
and get this error

salt 'USAV-*' pkg.available_version 'firefox'

USAV-*1:

The minion function caused an exception: Traceback (most recent call
last):

File "c:\salt\bin\lib\site-packages\salt\minion.py", line 1071, in
_thread_return

return_data = func(*args, **kwargs)

File "c:\salt\bin\lib\site-packages\salt\modules\win_pkg.py", line
103, in latest_version

latest_available = _get_latest_pkg_version(pkg_info)

File "c:\salt\bin\lib\site-packages\salt\modules\win_pkg.py", line
1088, in _get_latest_pkg_version

return sorted(pkginfo, cmp=_reverse_cmp_pkg_versions).pop()

IndexError: pop from empty list
Post by a***@gmail.com
Minion is running the 64-bit 2015.8.2 and then I also update the settings
in the master to reflect the new variables as it complained about the
deprecated variables. I should mention as well that my file roots is also
set so that the states live at a custom location. I noticed it said
something about caching the wirepo at base ?
Post by Shane Lee
What version is your minion?
Post by a***@gmail.com
So I setup the windows software repository using
win_repo: '/salt/states/win/repo-ng'
#
win_repo_mastercachefile: 'winrepo.p'
#
# - 'https://github.com/saltstack/salt-winrepo-ng.git'
I did the salt-run winrepo.update_git_repos and the salt-run
winrepo.genrepo followed by salt '*' pkg.refresh_db
the first problem I noticed was that the winrepo.p was not getting
pushed down to the client so I made the winrepo.p file into a symbolic link
from the /salt/states/win/repo-ng and then added it to my state which looks
- source: salt://packages/winrepo.p
- name: Web-Server
- 7zip
----------
ID: c:\scripts
Function: file.directory
Result: True
Comment: Directory c:\scripts is in the correct state
Started: 16:04:28.239000
Duration: 31.0 ms
----------
ID: c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p
Function: file.managed
Result: True
Comment: File c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p is in the correct state
Started: 16:04:28.270000
Duration: 63.0 ms
----------
ID: WebServerRole
Function: win_servermanager.installed
Name: Web-Server
Result: True
Comment: The feature Web-Server is already installed
Started: 16:04:28.817000
Duration: 2172.0 ms
----------
ID: 7zip
Function: pkg.installed
Result: False
Comment: The following packages failed to install/update: 7zip
Started: 16:04:31.458000
Duration: 140.0 ms
----------
Unable to locate package 7zip
Summary
------------
Succeeded: 3 (changed=1)
Failed: 1
------------
Total states run: 4
my setup is as follows for my states
salt
--states
--base
--development
--pwstest
--box in question is under this one with the above init.sls
--nginx
--otherstate
production
--pws
--nginx
--otherstate
this is what i see if I launch the salt-minion on windows in debug
[DEBUG ] Could not LazyLoad pkg.ex_mod_init
[INFO ] Running state [7zip] at time 16:52:13.711000
[INFO ] Executing state pkg.installed for 7zip
[DEBUG ] Could not LazyLoad pkg.normalize_name
[DEBUG ] Could not LazyLoad pkg.check_db
[INFO ] Caching directory u'win/repo-ng/' for environment 'base'
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not LazyLoad pkg.normalize_name
[ERROR ] Unable to locate package 7zip
[DEBUG ] Could not LazyLoad pkg.hold
[ERROR ] {'7zip': 'Unable to locate package 7zip'}
[DEBUG ] Refreshing modules...
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shane Lee
2016-04-27 18:21:42 UTC
Permalink
I would try removing all the custom settings you have in the master config
and let salt use the defaults, which looks like what you're trying to do
anyways.

Also note that these parameter names have changed in Salt 2015.8
(https://docs.saltstack.com/en/latest/topics/windows/windows-package-manager.html#config-parameters-renamed)

Also note that `winrepo.p` is no longer copied to the minion from the
master. Instead the .sls files are copied to and parsed by the minion, thus
creating the winrepo.p file locally on the minion. This is section explains
the process in
detail: https://docs.saltstack.com/en/latest/topics/windows/windows-package-manager.html#maintaining-windows-repo-definitions-in-git-repositories
Post by a***@gmail.com
So I setup the windows software repository using
win_repo: '/salt/states/win/repo-ng'
#
win_repo_mastercachefile: 'winrepo.p'
#
# - 'https://github.com/saltstack/salt-winrepo-ng.git'
I did the salt-run winrepo.update_git_repos and the salt-run
winrepo.genrepo followed by salt '*' pkg.refresh_db
the first problem I noticed was that the winrepo.p was not getting pushed
down to the client so I made the winrepo.p file into a symbolic link from
- source: salt://packages/winrepo.p
- name: Web-Server
- 7zip
----------
ID: c:\scripts
Function: file.directory
Result: True
Comment: Directory c:\scripts is in the correct state
Started: 16:04:28.239000
Duration: 31.0 ms
----------
ID: c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p
Function: file.managed
Result: True
Comment: File c:\salt\var\cache\salt\minion\files\development\win\repo-ng\winrepo.p is in the correct state
Started: 16:04:28.270000
Duration: 63.0 ms
----------
ID: WebServerRole
Function: win_servermanager.installed
Name: Web-Server
Result: True
Comment: The feature Web-Server is already installed
Started: 16:04:28.817000
Duration: 2172.0 ms
----------
ID: 7zip
Function: pkg.installed
Result: False
Comment: The following packages failed to install/update: 7zip
Started: 16:04:31.458000
Duration: 140.0 ms
----------
Unable to locate package 7zip
Summary
------------
Succeeded: 3 (changed=1)
Failed: 1
------------
Total states run: 4
my setup is as follows for my states
salt
--states
--base
--development
--pwstest
--box in question is under this one with the above init.sls
--nginx
--otherstate
production
--pws
--nginx
--otherstate
this is what i see if I launch the salt-minion on windows in debug
[DEBUG ] Could not LazyLoad pkg.ex_mod_init
[INFO ] Running state [7zip] at time 16:52:13.711000
[INFO ] Executing state pkg.installed for 7zip
[DEBUG ] Could not LazyLoad pkg.normalize_name
[DEBUG ] Could not LazyLoad pkg.check_db
[INFO ] Caching directory u'win/repo-ng/' for environment 'base'
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not LazyLoad pkg.normalize_name
[ERROR ] Unable to locate package 7zip
[DEBUG ] Could not LazyLoad pkg.hold
[ERROR ] {'7zip': 'Unable to locate package 7zip'}
[DEBUG ] Refreshing modules...
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...