Windows: pkg.list_available is always empty

441 views
Skip to first unread message

Mike Carlson

unread,
Oct 11, 2013, 3:56:17 PM10/11/13
to salt-...@googlegroups.com
Hey Salt-Users,

I'd really like to start using Salt as a package provider for our Windows systems, but I cannot seem to get the basic pkg.list_available to return anything.

I've cloned the salt-winrepo, modified the master config:

salt-1# pwd
/usr/local/etc/salt/win/salt-winrepo
salt-1# ls
.git README.md blender.sls filezilla.sls mysysgit.sls nsclient.sls pidgin.sls realvnc.sls winrepo.p
7zip.sls audacity.sls chrome.sls gvim.sls npp.sls nxlog.sls putty.sls vlc.sls
salt-1# grep winrepo /usr/local/etc/salt/master
win_repo: '/usr/local/etc/salt/win/salt-winrepo'
win_repo_mastercachefile: '/usr/local/etc/salt/win/salt-winrepo/winrepo.p'

Running 'salt-run winrepo.genrepo' appears to work just fine:
salt-1# salt-run winrepo.genrepo
{'name_map': {'7-Zip 9.20 (x64 edition)': '7zip',
              'Audacity 2.0.3': 'audacity',
              'Blender': 'blender',
              'FileZilla Client 3.6.0.2': 'filezilla',
              'Git version 1.8.1.2-preview20130201': 'mysysgit',
              'Google Chrome': 'chrome',
              'NSClient++ (x64)': 'nsclient',
              'NXLOG-CE': 'nxlog',
              'Notepad++': 'npp',
              'Pidgin': 'pidgin',
              'PuTTY version 0.62': 'putty',
              'VLC media player 2.0.7': 'vlc',
              'VNC Server 5.0.5': 'realvnc',
              'Vim 7.3 (self-installing)': 'gvim'},
 'repo': {'7zip': {'9.20.00.0': {'full_name': '7-Zip 9.20 (x64 edition)',
                                 'install_flags': ' /q ',
                                 'installer': 'http://hivelocity.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920-x64.msi',
                                 'msiexec': True,
                                 'reboot': False,
                                 'uninstall_flags': ' /qn',
                                 'uninstaller': 'http://hivelocity.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920-x64.msi'}},
          'audacity': {'2.0.3': {'full_name': 'Audacity 2.0.3',
                                 'install_flags': ' /sp- /verysilent /norestart',
                                 'installer': 'http://audacity.googlecode.com/files/audacity-win-2.0.3.exe',
                                 'locale': 'en_US',
                                 'reboot': False,
                                 'uninstall_flags': ' /verysilent',
                                 'uninstaller': '%PROGRAMFILES(x86)%\\Audacity\\unins000.exe'}},
          'blender': {'2.68': {'full_name': 'Blender',
                               'install_flags': '/S',
                               'installer': 'http://ftp.nluug.nl/pub/graphics/blender/release//Blender2.68/blender-2.68-windows32.exe',
                               'reboot': False,
                               'uninstall_flags': '/S',
                               'uninstaller': '%ProgramFiles(x86)%\\Blender Foundation\\Blender\\uninstall.exe'}},
          'chrome': {'65.130.49228': {'full_name': 'Google Chrome',
                                      'install_flags': '/qn /norestart',
                                      'installer': 'salt://win/repo/chrome/GoogleChromeStandaloneEnterprise.msi',
                                      'msiexec': True,
                                      'reboot': False,
                                      'uninstall_flags': '/qn',
                                      'uninstaller': 'salt://win/repo/chrome/GoogleChromeStandaloneEnterprise.msi'}},
          'filezilla': {'3.6.0.2': {'full_name': 'FileZilla Client 3.6.0.2',
                                    'install_flags': ' /S',
                                    'uninstall_flags': ' /S',
                                    'uninstaller': '%ProgramFiles(x86)%\\FileZilla FTP Client\\uninstall.exe'}},
          'gvim': {'7.3': {'full_name': 'Vim 7.3 (self-installing)',
                           'install_flags': '/TYPE=FULL /S /DD',
                           'installer': 'https://github.com/downloads/gpwen/vim-installer-mui2/gvim73_46-int-v0.9.exe',
                           'reboot': False,
                           'uninstall_flags': '/S',
                           'uninstaller': '%PROGRAMFILES(x86)%\\Vim\\vim73\\uninstall-gui.exe'}},
          'mysysgit': {'1.8.1.2-preview20130201': {'full_name': 'Git version 1.8.1.2-preview20130201',
                                                   'install_flags': ' /VERYSILENT /NOREBOOT',
                                                   'installer': 'salt://win/repo/mysysgit/Git-1.8.1.2.exe',
                                                   'reboot': False}},
          'npp': {'6.4.2': {'full_name': 'Notepad++',
                            'install_flags': ' /S',
                            'installer': 'http://download.tuxfamily.org/notepadplus/6.4.2/npp.6.4.2.Installer.exe',
                            'reboot': False,
                            'uninstall_flags': ' /S',
                            'uninstaller': '%ProgramFiles(x86)%/Notepad++/uninstall.exe'}},
          'nsclient': {'0.3.9.328': {'full_name': 'NSClient++ (x64)',
                                     'install_flags': '/quiet',
                                     'installer': 'http://files.nsclient.org/0.3.x/NSClient%2B%2B-0.3.9-x64.msi',
                                     'msiexec': True,
                                     'reboot': False,
                                     'uninstall_flags': '/quiet',
                                     'uninstaller': 'http://files.nsclient.org/0.3.x/NSClient%2B%2B-0.3.9-x64.msi'}},
          'nxlog': {'2.5.1089': {'full_name': 'NXLOG-CE',
                                 'install_flags': '/quiet /norestart',
                                 'installer': 'http://downloads.sourceforge.net/project/nxlog-ce/nxlog-ce-2.5.1089.msi',
                                 'msiexec': True,
                                 'reboot': False,
                                 'uninstall_flags': '/quiet /norestart',
                                 'uninstaller': 'http://downloads.sourceforge.net/project/nxlog-ce/nxlog-ce-2.5.1089.msi'}},
          'pidgin': {'2.10.6': {'full_name': 'Pidgin',
                                'install_flags': ' /S',
                                'installer': 'http://hivelocity.dl.sourceforge.net/project/pidgin/Pidgin/2.10.6/pidgin-2.10.6-offline.exe',
                                'reboot': False,
                                'uninstall_flags': ' /S',
                                'uninstaller': '%programfiles(x86)%/Pidgin/pidgin-uninst.exe'}},
          'putty': {'0.62': {'full_name': 'PuTTY version 0.62',
                             'install_flags': '/sp- /verysilent',
                             'installer': 'http://the.earth.li/~sgtatham/putty/0.62/x86/putty-0.62-installer.exe',
                             'reboot': False,
                             'uninstall_flags': '/sp- /verysilent /norestart',
                             'uninstaller': '%PROGRAMFILES(x86)%\\PuTTY\\unins000.exe'}},
          'realvnc': {'5.0.5': {'full_name': 'VNC Server 5.0.5',
                                'install_flags': '/sp- /verysilent /norestart',
                                'installer': 'salt://win/repo/realvnc/VNC-5.0.5-Windows.exe',
                                'reboot': False,
                                'uninstall_flags': '/sp- /verysilent /norestart',
                                'uninstaller': '%PROGRAMFILES%\\RealVNC\\VNC Server\\unins000.exe'}},
          'vlc': {'2.0.7': {'full_name': 'VLC media player 2.0.7',
                            'install_flags': ' /S',
                            'installer': 'http://get.videolan.org/vlc/2.0.7/win32/vlc-2.0.7-win32.exe',
                            'reboot': False,
                            'uninstall_flags': ' /S',
                            'uninstaller': '%programfiles(x86)%/VideoLAN/VLC/uninstall.exe'}}}}

pkg.refresh_db returns true:
salt-1# salt 'b-bot*' pkg.refresh_db
    True
salt-1# 

However, listing any available packages is empty:

salt-1# salt 'b-bot*' pkg.list_available
    
salt-1# salt 'b-bot*' pkg.list_available vlc
    
Both the minion and master are running 0.17. The minion is a Win7 system, however, I have the same issue on 2008R2  and 2003R2 Windows servers as well.

Anyway, I hope it is something really simple on my behalf, thanks for the rockin' tools!

Mike C

David Boucha

unread,
Oct 14, 2013, 12:25:00 PM10/14/13
to salt users list
Mike,

Thanks for reporting this. 

Does the following command work to actually install vlc?

   salt 'b-bot*' pkg.install vlc




--
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/groups/opt_out.



--
Dave Boucha  |  Sr. Engineer


5272 South College Drive, Suite 301 | Murray, UT 84123

office 801-305-3563
da...@saltstack.com | www.saltstack.com

Mike Carlson

unread,
Oct 14, 2013, 12:55:37 PM10/14/13
to salt-...@googlegroups.com
Nope:

salt-1# salt -v 'b-bot*' pkg.install vlc
Executing job with jid 20131014095502666851
-------------------------------------------

    ----------
salt-1# 





--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/FZ5eGc9FmwI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.

Mike Carlson

unread,
Oct 17, 2013, 3:29:32 PM10/17/13
to salt-...@googlegroups.com
Is there any further information I can provide? Should I open up a issue on github?
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Dave Boucha  |  Sr. Engineer


5272 South College Drive, Suite 301 | Murray, UT 84123

office 801-305-3563
da...@saltstack.com | www.saltstack.com

--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/FZ5eGc9FmwI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+unsubscribe@googlegroups.com.

Olivier Trempe

unread,
Oct 17, 2013, 4:28:49 PM10/17/13
to salt-...@googlegroups.com
Hi Mike, 

I suggest you look at my other post: https://groups.google.com/forum/#!topic/salt-users/bTjmwttgxvY

I think this might be linked.
I remember calling the pkg.list_available command and getting nothing.

I finally made it work by installing minion 0.16.3 instead of 0.17.0. (David confirmed he needs to rebuild the windows installer as it is broken)

Just to make sure, inspect the debug log of the windows minion to see if you get a msgpack error. If so, try installing 0.16.3 and it should work.

Olivier
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/groups/opt_out.



--
Dave Boucha  |  Sr. Engineer


5272 South College Drive, Suite 301 | Murray, UT 84123

office 801-305-3563
da...@saltstack.com | www.saltstack.com

--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/FZ5eGc9FmwI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.

Mike Carlson

unread,
Oct 18, 2013, 1:18:02 PM10/18/13
to salt-...@googlegroups.com
I've installed 0.16.3 (64bit) on another system, and the same behavior exists, I did notice this once I changed the log level to debug:

2013-10-18 10:08:46,462 [salt.fileclient  ][INFO    ] Fetching file 'salt://win/repo/winrepo.p'
2013-10-18 10:08:46,462 [salt.loaded.int.module.cp][ERROR   ] Unable to cache file "salt://win/repo/winrepo.p" from env "base".
2013-10-18 10:08:46,462 [salt.loaded.int.module.win_pkg][ERROR   ] Not able to read repo file
2013-10-18 10:08:46,462 [salt.loaded.int.module.win_pkg][ERROR   ] [Errno 22] invalid mode ('r') or filename: ''
Traceback (most recent call last):
  File "salt/modules/win_pkg.py", line 664, in get_repo_data
  File "salt/utils/__init__.py", line 825, in fopen
IOError: [Errno 22] invalid mode ('r') or filename: ''


Perhaps I have an invalid windows repo? I've since changed it and retried with these settings on the salt master:

#####     Windows Software Repo settings #####
##############################################
# Location of the repo on the master
win_repo: '/usr/local/etc/salt/win/repo'

# Location of the master's repo cache file
win_repo_mastercachefile: '/usr/local/etc/salt/win/repo/winrepo.p'

Those files exist on the file system:

salt-1# ls -al /usr/local/etc/salt/win/repo
total 76
drwxr-xr-x  3 root  wheel   512 Oct 18 10:06 .
drwxr-xr-x  4 root  wheel   512 Oct 18 10:06 ..
drwxr-xr-x  8 root  wheel   512 Oct 18 10:06 .git
-rw-r--r--  1 root  wheel   346 Oct 11 12:39 7zip.sls
-rw-r--r--  1 root  wheel   223 Oct 11 12:39 README.md
-rw-r--r--  1 root  wheel   308 Oct 11 12:39 audacity.sls
-rw-r--r--  1 root  wheel   297 Oct 11 12:39 blender.sls
-rw-r--r--  1 root  wheel   380 Oct 11 12:39 chrome.sls
-rw-r--r--  1 root  wheel   358 Oct 11 12:39 filezilla.sls
-rw-r--r--  1 root  wheel   301 Oct 11 12:39 gvim.sls
-rw-r--r--  1 root  wheel   288 Oct 11 12:39 mysysgit.sls
-rw-r--r--  1 root  wheel   274 Oct 11 12:39 npp.sls
-rw-r--r--  1 root  wheel   310 Oct 11 12:39 nsclient.sls
-rw-r--r--  1 root  wheel   342 Oct 11 12:39 nxlog.sls
-rw-r--r--  1 root  wheel   287 Oct 11 12:39 pidgin.sls
-rw-r--r--  1 root  wheel   304 Oct 11 12:39 putty.sls
-rw-r--r--  1 root  wheel   300 Oct 11 12:39 realvnc.sls
-rw-r--r--  1 root  wheel   269 Oct 11 12:39 vlc.sls
-rw-r--r--  1 root  wheel  3944 Oct 18 10:06 winrepo.p
salt-1# ls -al /usr/local/etc/salt/win/repo/winrepo.p
-rw-r--r--  1 root  wheel  3944 Oct 18 10:06 /usr/local/etc/salt/win/repo/winrepo.p

Same error after restarting the windows salt minions and rebuilding the winrepo.p file.

Mike C

Mike Carlson

unread,
Oct 18, 2013, 6:26:48 PM10/18/13
to salt-...@googlegroups.com
I appreciate everyone's patience and input, I think I have found my problem :)

I had the winrepo outside of the salt- state directory, so as soon as I placed it in there, I was able to install vlc, putty, and other defined programs. Is that the correct way of managing windows repositories?

salt-1# salt 'biz-4*' pkg.list_available vlc
    - 2.0.7
salt-1# salt 'biz-4*' pkg.list_available 
    
salt-1# salt 'biz-4*' pkg.list_available putty
    - 0.62
salt-1# salt 'biz-4*' pkg.install putty
salt-1# salt 'biz-4*' pkg.list_pkg putty
    "pkg.list_pkg" is not available.
salt-1# salt 'biz-4*' pkg.list_pkgs putty
....
    putty:
        0.62

Again, thanks for the assistance

Mike C


On Friday, October 11, 2013 12:56:17 PM UTC-7, Mike Carlson wrote:

dim...@gmail.com

unread,
Nov 4, 2013, 12:49:24 PM11/4/13
to salt-...@googlegroups.com
Hi Mike,

Did you hear back about whether the Window repo is designed to only reside in the base salt directory?

Thanks,
Dave

Mike Carlson

unread,
Nov 4, 2013, 1:54:34 PM11/4/13
to salt-...@googlegroups.com
Nope, I haven't heard otherwise, so I'll keep it inside the state's file location until I learn otherwise :)


--
Reply all
Reply to author
Forward
0 new messages