Salt and Windows - Install packages from UNC ?

686 views
Skip to first unread message

Didier Pelligra

unread,
Aug 2, 2016, 11:44:18 AM8/2/16
to Salt-users
Hi,

I'm using Salt 2016.3.1. Master runs on Linux and minion on Windows 7.

I can easily deploy/remove/purge packages from the master given that the package can be installed from a single exe or msi file.

Now I need to deploy packages that consist in a full directory from which i have to launch an exe or a msi. I tried two things :


- Making my own exe package which once launched setups the software. Problem : salt always states that the package failed to install even if my package could install everything correctly. This also prevents me from removing the package with salt :

pcta-cta-devf:
----------
          ID: adobereader
    Function: pkg.installed
      Result: False
     Comment: The following packages failed to install/update: adobereader=11.0
     Started: 16:55:39.812000
    Duration: 186969.0 ms
     Changes:
              ----------
              Adobe Reader XI  MUI:
                  ----------
                  new:
                      11.0.00
                  old:
              adobereader:
                  ----------
                  install status:
                      success

- Sharing the install directory from samba, on the salt master, and putting in my sls file the UNC path like this :
adobereader:
  '11.0':
    full_name: 'Adobe Reader XI (11.0)'
    installer: '\\\\repo\\wininstall\\adobereader11\\setup.exe'
    install_flags: ''
    uninstaller: 'msiexec.exe'
    uninstall_flags: '/qn /x {AC76BA86-7AD7-FFFF-7B44-AB0000000001} /norestart'
    msiexec: False
    locale: fr_FR
    reboot: False

This doesnt work at all :

pcta-cta-devf:
----------
          ID: adobereader
    Function: pkg.installed
      Result: False
     Comment: An error was encountered while installing package(s): Specified cwd '\\\\repo\\wininstall\\adobereader11' either not absolute or does not exist
     Started: 17:31:11.171000
    Duration: 32.0 ms
     Changes:


Any idea on the best option here ?

Thanks !


David Boucha

unread,
Aug 2, 2016, 12:27:31 PM8/2/16
to salt users list
The salt-minion runs as the System User, by default. If my memory is correct, the System User can't access UNC paths. You'd have to mount that UNC path to a letter drive.

Try changing your package definition sls file to use  11.0.00  instead of 11.0.

--
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.

Didier Pelligra

unread,
Aug 4, 2016, 8:42:09 AM8/4/16
to Salt-users
Hi,

I tried changing the version without success.

Now i'm able to install from UNC path. Here is the sls :

[root@sysadm-cta-devf repo]# cat /srv/salt/win/repo-ng/adobereader.sls
adobereader:
  '11.0.00':
    full_name: 'Adobe Reader XI (11.0)'
    installer: '\\repo\wininstall\adobereader11\AcroRead.msi'
    install_flags: 'TRANSFORMS=AcroRead.mst /qn /L*v C:\\adobe.log'
    uninstaller: '{AC76BA86-7AD7-FFFF-7B44-AB0000000001}'
    uninstall_flags: '/qn /norestart'
    msiexec: True
    locale: fr_FR
    reboot: False
[root@sysadm-cta-devf repo]#



The install goes smoothly as far as Windows can tell, but on salt-master not :

[root@sysadm-cta-devf repo]# salt pcta-cta-devf state.highstate
[DEBUG   ] Configuration file path: /etc/salt/master
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/sis.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/sis.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: sysadm-cta-devf
[DEBUG   ] Missing configuration file: /root/.saltrc
[DEBUG   ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'sysadm-cta-devf_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] LazyLoaded local_cache.get_load
[DEBUG   ] Reading minion list from /var/cache/salt/master/jobs/a9/ccc7318dabd32397355ea7ab1905ba/.minions.p
[DEBUG   ] get_iter_returns for jid 20160803100849034716 sent to set(['pcta-cta-devf']) will timeout at 10:08:54.046756
[DEBUG   ] Checking whether jid 20160803100849034716 is still running
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'sysadm-cta-devf_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] jid 20160803100849034716 return from pcta-cta-devf
[DEBUG   ] LazyLoaded highstate.output
[DEBUG   ] LazyLoaded nested.output
pcta-cta-devf:
----------
          ID: adobereader
    Function: pkg.installed
      Result: False
     Comment: The following packages failed to install/update: adobereader=11.0.00
     Started: 10:08:59.953000
    Duration: 2765.0 ms
     Changes:
              ----------
              adobereader:
                  ----------
                  install status:
                      success

Summary for pcta-cta-devf
------------
Succeeded: 3 (changed=1)
Failed:    1
------------
Total states run:     4
[DEBUG   ] jid 20160803100849034716 found all minions set(['pcta-cta-devf'])
[root@sysadm-cta-devf repo]#

Then again i can't uninstall it from salt as it's not officially installed.

Didier Pelligra

unread,
Aug 4, 2016, 11:10:01 AM8/4/16
to Salt-users
I think my main problem is that i can easily install acrobat reader using :
[root@sysadm-cta-devf ~]# salt pcta-cta-devf pkg.install adobereader version=11.0.10
pcta-cta-devf:
    ----------
    Adobe Reader XI (11.0.10) - Français:
        ----------
        new:
            11.0.10
        old:
    adobereader:
        ----------
        install status:
            success
[root@sysadm-cta-devf ~]# 

But if i then launch my highstate, which load the very same acrobat reader sls it gives :

[root@sysadm-cta-devf ~]# salt pcta-cta-devf state.highstate test=true
pcta-cta-devf:
----------
          ID: adobereader
    Function: pkg.installed
      Result: None
     Comment: The following packages would be installed/updated: adobereader=11.0.10
     Started: 17:07:22.984000
    Duration: 31.0 ms
     Changes:

Summary for pcta-cta-devf
------------
Succeeded: 4 (unchanged=1)
Failed:    0
------------
Total states run:     4
[root@sysadm-cta-devf ~]#

So it considers the package was not installed.

With 7zip I have no problem at all



Le mardi 2 août 2016 17:44:18 UTC+2, Didier Pelligra a écrit :

Didier Pelligra

unread,
Aug 5, 2016, 9:31:03 AM8/5/16
to Salt-users
Problem seems to be solved. The full_name was inconsitent with the name found in registry after installation. There is an extra space in Windows and when i put it in my sls, all is fine.

THanks

David Boucha

unread,
Aug 5, 2016, 2:04:10 PM8/5/16
to salt users list
Ah, thanks for letting us know! Is this sls file from the
salt-winrepo-ng? If so, could you add the fix to the sls file there?

Thanks!
Reply all
Reply to author
Forward
0 new messages