Skip to content

Instantly share code, notes, and snippets.

@whytewolf
Last active October 21, 2015 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whytewolf/ae532b0a772bfec538f1 to your computer and use it in GitHub Desktop.
Save whytewolf/ae532b0a772bfec538f1 to your computer and use it in GitHub Desktop.
import salt.config
import salt.loader
__opts__ = salt.config.minion_config('/etc/salt/minion')
__grains__ = salt.loader.grains(__opts__)
__opts__['grains'] = __grains__
__salt__ = salt.loader.minion_mods(__opts__)
pkglist = __salt__['pkg.list_pkgs']()
print pkglist
import salt.client
local = salt.client.LocalClient()
pkglist = local.cmd('*', 'pkg.list_pkgs')
print pkglist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment