salt.runners.pillar

Functions to interact with the pillar compiler on the master

salt.runners.pillar.show_pillar(minion='*', **kwargs)

Returns the compiled pillar either of a specific minion or just the global available pillars. This function assumes that no minion has the id *.

命令行接口CLI 范例:

shows minion specific pillar:

salt-run pillar.show_pillar 'www.example.com'

shows global pillar:

salt-run pillar.show_pillar

shows global pillar for 'dev' pillar environment:

salt-run pillar.show_pillar 'saltenv=dev'

API Example:

import salt.config
import salt.runner
opts = salt.config.master_config('/etc/salt/master')
runner = salt.runner.RunnerClient(opts)
pillar = runner.cmd('pillar.show_pillar', [])
print(pillar)
salt.runners.pillar.show_top(minion=None, saltenv='base')

Returns the compiled top data for pillar for a specific minion. If no minion is specified, we use the first minion we find.

命令行接口CLI 范例:

salt-run pillar.show_top