Do this if package is installed

1,762 views
Skip to first unread message

Steve Pribyl

unread,
Jun 25, 2014, 9:55:41 AM6/25/14
to salt-...@googlegroups.com
Is there a grain or data structure that I an querey in an init.sls file that will test for the presence of a package?

Thanks
--
Steve Pribyl
Sr. Systems Administrator
steve....@akunacapital.com
Desk: 312-994-4646
Cell: 847-343-2349
________________________________
[http://www.akunacapital.com/images/akuna.png]
Steve Pribyl | Senior Systems Engineer
Akuna Capital LLC
36 S Wabash, Suite 310 Chicago IL 60603 USA | www.akunacapital.com <http://www.akunacapital.com>
p: +1 312 994 4646 | f: +1 312 750 1667 | Steve....@akunacapital.com

Please consider the environment, before printing this email.

This electronic message contains information from Akuna Capital LLC that may be confidential, legally privileged or otherwise protected from disclosure. This information is intended for the use of the addressee only and is not offered as investment advice to be relied upon for personal or professional use. Additionally, all electronic messages are recorded and stored in compliance pursuant to applicable SEC rules. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or any other use of, or any action in reliance on, the contents of this electronic message is strictly prohibited. If you have received this communication in error, please notify us by telephone at (312)994-4640 and destroy the original message.

JM

unread,
Jun 25, 2014, 10:18:17 AM6/25/14
to salt-...@googlegroups.com

Daniel Jagszent

unread,
Jun 25, 2014, 10:34:19 AM6/25/14
to salt-...@googlegroups.com
You can call a salt module like this http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.aptpkg.html#salt.modules.aptpkg.version from whitin a .sls file.

e.g. if you use Jinja

{% if salt['pkg.version']('my-package') %}
# put your state definitions here
{% endif %}

Xzenor

unread,
Mar 29, 2022, 4:14:10 AM3/29/22
to Salt-users
Thanks Dan,

Almost 8 years later but still works like a charm 👍

Op woensdag 25 juni 2014 om 16:34:19 UTC+2 schreef dan...@jagszent.de:
Reply all
Reply to author
Forward
0 new messages