Looking for an example of installing RPM's via pkg.installed sources

2,303 views
Skip to first unread message

Clint Dilks

unread,
Sep 10, 2013, 12:41:08 AM9/10/13
to salt-...@googlegroups.com
Hi I have tried using the following state

mysql-client:
  pkg.installed:
    - skip_verify: True
    - sources:
      - mysql-client: salt://mysql-client/MySQL-client-5.6.13-1.el6.x86_64.rpm
      - mysql-devel: salt://mysql-client/MySQL-devel-5.6.13-1.el6.x86_64.rpm

But running this causes an exception, can anyone point me to an example similar to this that works ?

  State: - pkg
    Name:      mysql-client
    Function:  installed
        Result:    False
        Comment:   An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/state.py", line 1237, in call
    *cdata['args'], **cdata['kwargs'])
  File "/usr/lib/python2.6/site-packages/salt/states/pkg.py", line 386, in installed
    **kwargs)
  File "/usr/lib/python2.6/site-packages/salt/modules/yumpkg.py", line 501, in install
    **kwargs)
  File "/usr/lib/python2.6/site-packages/salt/modules/pkg_resource.py", line 291, in parse_targets
    problems = _verify_binary_pkg(srcinfo)
  File "/usr/lib/python2.6/site-packages/salt/modules/pkg_resource.py", line 195, in _verify_binary_pkg
    pkgmeta_name, pkgmeta_version = _parse_pkg_meta(pkg_path)
  File "/usr/lib/python2.6/site-packages/salt/modules/pkg_resource.py", line 114, in _parse_pkg_meta
    return metaparser(path)
  File "/usr/lib/python2.6/site-packages/salt/modules/pkg_resource.py", line 38, in parse_rpm
    pkginfo = _parse_pkginfo(pkginfo)
  File "/usr/lib/python2.6/site-packages/salt/modules/yumpkg5.py", line 71, in _parse_pkginfo
    pkginfo = collections.namedtuple('PkgInfo', ('name', 'version'))
NameError: global name 'collections' is not defined

Thanks

Nick Davis

unread,
Sep 10, 2013, 9:23:10 AM9/10/13
to salt-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your state only has 1 potential issue. You want the ID for the state to
be different from the package names. So, for the first line of your
state, change mysql-client to something like mysql-client-pkgs.

That NameError looks like a bug in salt that was fixed in the develop
branch right after the release of 16.3. I am hopeful that the fix will
be included in the next release.

Nick
> --
> 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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlIvHT4ACgkQYoNGId/piAukTQCgmoFaX9/SQDWVO5khDhuTMu5a
x20An0Y2+r8mfX7S3j/lgmqO2ajGWuLn
=RIxW
-----END PGP SIGNATURE-----

Colton Myers

unread,
Sep 10, 2013, 11:30:56 AM9/10/13
to salt-...@googlegroups.com
Yes, if I remember correctly I cherry-picked it, and it will be in 0.16.4 (probably announced later today, already on PyPI).

--
Colton Myers

Clint Dilks

unread,
Sep 10, 2013, 4:18:43 PM9/10/13
to salt-...@googlegroups.com
On Wed, Sep 11, 2013 at 1:23 AM, Nick Davis <mrt...@gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your state only has 1 potential issue. You want the ID for the state to
be different from the package names. So, for the first line of your
state, change mysql-client to something like mysql-client-pkgs.

That NameError looks like a bug in salt that was fixed in the develop
branch right after the release of 16.3. I am hopeful that the fix will
be included in the next release.

Nick


Hi Nick

Thanks for confirming I wasn't missing something too obvious :)

Clint Dilks

unread,
Sep 10, 2013, 4:28:11 PM9/10/13
to salt-...@googlegroups.com



On Wed, Sep 11, 2013 at 3:30 AM, Colton Myers <colton...@gmail.com> wrote:
Yes, if I remember correctly I cherry-picked it, and it will be in 0.16.4 (probably announced later today, already on PyPI).


Thanks

As a question would the SALT team recommend that most people stick with the Salt Packages released by their distribution for production systems, or use the python install in general?
Normally I would stick with the EPEL RPMS but development in salt seems to be very quick.

Anyone else have thoughts on the issue ?




 

Colton Myers

unread,
Sep 10, 2013, 4:55:25 PM9/10/13
to salt-...@googlegroups.com
Generally, we recommend installing salt from the packages just as an easy way to get the dependencies and so forth.

Then if you want to upgrade to a development version, it's simple to clone the repo and run `python setup.py install --force`.

But really either way is fine.  It's all python.  =)

Oh, and I should note that epel-testing usually has releases of salt within a few days of their release, so it's usually pretty up to date.

--
Colton Myers


--
Reply all
Reply to author
Forward
0 new messages