salt.output.newline_values_only

Display values only, separated by newlines

2015.5.0 新版功能.

This outputter is designed for Salt CLI return data. It will do the following to the return dict:

  1. Get just the values (ignoring the minion IDs).
  2. Each value, if it is iterable, is split a separate line.
  3. Each minion's values are separated by newlines.

This results in a single string of return data containing all the values from the various minions.

警告

As noted above, this outputter will discard the minion ID. If the minion ID is important, then an outputter that returns the full return dictionary in a parsable format (such as json, pprint,, or yaml) may be more suitable.

Example 1

Input

{
    'myminion': ['127.0.0.1', '10.0.0.1'],
    'second-minion': ['127.0.0.1', '10.0.0.2']
}

output 输出

127.0.0.1
10.0.0.1
127.0.0.1
10.0.0.2

Example 2

Input

{
    'myminion': 8,
    'second-minion': 10
}

output 输出

8
10
salt.output.newline_values_only.output(data)

Display modified ret data