Installing rpm on debian using pkg.installed

181 views
Skip to first unread message

Wayne Christopher

unread,
Dec 30, 2013, 6:55:29 PM12/30/13
to salt-...@googlegroups.com
I have a state that looks like this:

my-package:
  pkg.installed:
    - sources:
        - my-package-base : salt://files/my-package-base.x86_64.rpm
    - skip_verify: True

It installs fine on CentOS, but on an Ubuntu system I get the following error on the minions:

2013-12-30 15:44:25,620 [salt.loaded.int.module.cmdmod               ][ERROR   ] Command 'dpkg-deb -I "/var/cache/salt/minion/files/base/files/my-package-base.x86_64.rpm"' failed with return code: 2
2013-12-30 15:44:25,620 [salt.loaded.int.module.cmdmod               ][ERROR   ] stderr: dpkg-deb: error: `/var/cache/salt/minion/files/base/files/my-package-base.x86_64.rpm' is not a debian format archive

I do have the rpm program installed on this machine.  Shouldn't the pkg.installed state use the rpm installer since that's what the file type is, instead of (I assume) using dpkg-deb because it's an Ubuntu system?

Can anybody suggest a workaround?

Thanks,

    Wayne

Ben Hosmer

unread,
Dec 31, 2013, 10:43:00 AM12/31/13
to salt-...@googlegroups.com
I might be wrong here, but I don't think the Debian package manager can directly install an RPM.

You could try using RPM to directly install it. This might be an option or a feature request for the SALT packaging though to check if RPM is installed and use that instead.

David Boucha

unread,
Dec 31, 2013, 11:00:40 AM12/31/13
to salt users list

You can specify the "provider" option

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

Wayne Christopher

unread,
Dec 31, 2013, 11:19:24 AM12/31/13
to salt-...@googlegroups.com
Could you give an example of how to do this?  If I add  "- provider: rpm" to the pkg.installed call, I get the error:

    State: - pkg
    Name:      perforce-client
    Function:  installed
        Result:    False
        Comment:   An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/salt/state.py", line 1305, in call
    *cdata['args'], **cdata['kwargs'])
  File "/usr/lib/pymodules/python2.7/salt/states/pkg.py", line 428, in installed
    fromrepo=fromrepo, **kwargs)
  File "/usr/lib/pymodules/python2.7/salt/states/pkg.py", line 110, in _find_install_targets
    cur_pkgs = __salt__['pkg.list_pkgs'](versions_as_list=True)
TypeError: list_pkgs() got an unexpected keyword argument 'versions_as_list'

Thanks!

    Wayne

Avi Marcus

unread,
Dec 31, 2013, 12:50:31 PM12/31/13
to salt-...@googlegroups.com
Seems there's a possibly unmerged bug regarding this mentioned here:


-Avi


Colton Myers

unread,
Jan 3, 2014, 11:50:15 AM1/3/14
to salt-...@googlegroups.com
I'm not sure that that issue is actually related.  

Wayne, could you file an issue?  We want to make sure provider overrides are working properly.

--
Colton Myers
Reply all
Reply to author
Forward
0 new messages