MCPcopy
hub / github.com/saltstack/salt / ext

Function ext

salt/modules/pillar.py:636–715  ·  view source on GitHub ↗

.. versionchanged:: 2016.3.6,2016.11.3,2017.7.0 The supported ext_pillar types are now tunable using the :conf_master:`on_demand_ext_pillar` config option. Earlier releases used a hard-coded default. Generate the pillar and apply an explicit external pillar ex

(external, pillar=None, unmask=None)

Source from the content-addressed store, hash-verified

634
635
636def ext(external, pillar=None, unmask=None):
637 '''
638 .. versionchanged:: 2016.3.6,2016.11.3,2017.7.0
639 The supported ext_pillar types are now tunable using the
640 :conf_master:`on_demand_ext_pillar` config option. Earlier releases
641 used a hard-coded default.
642
643 Generate the pillar and apply an explicit external pillar
644
645
646 external
647 A single ext_pillar to add to the ext_pillar configuration. This must
648 be passed as a single section from the ext_pillar configuration (see
649 CLI examples below). For more complicated ``ext_pillar``
650 configurations, it can be helpful to use the Python shell to load YAML
651 configuration into a dictionary, and figure out
652
653 .. code-block:: python
654
655 >>> import salt.utils.yaml
656 >>> ext_pillar = salt.utils.yaml.safe_load("""
657 ... ext_pillar:
658 ... - git:
659 ... - issue38440 https://github.com/terminalmage/git_pillar:
660 ... - env: base
661 ... """)
662 >>> ext_pillar
663 {'ext_pillar': [{'git': [{'mybranch https://github.com/myuser/myrepo': [{'env': 'base'}]}]}]}
664 >>> ext_pillar['ext_pillar'][0]
665 {'git': [{'mybranch https://github.com/myuser/myrepo': [{'env': 'base'}]}]}
666
667 In the above example, the value to pass would be
668 ``{'git': [{'mybranch https://github.com/myuser/myrepo': [{'env': 'base'}]}]}``.
669 Note that this would need to be quoted when passing on the CLI (as in
670 the CLI examples below).
671
672 pillar : None
673 If specified, allows for a dictionary of pillar data to be made
674 available to pillar and ext_pillar rendering. These pillar variables
675 will also override any variables of the same name in pillar or
676 ext_pillar.
677
678 .. versionadded:: 2015.5.0
679
680 unmask
681 If set to ``True``, the pillar data will be returned unmasked. If set
682 to ``False``, masked values are returned. The default of ``None``
683 auto-detects from the :func:`salt.utils.secret.mask_pillar` context
684 variable so direct user invocations see plain values while invocations
685 from inside the renderer/state pipeline stay masked.
686
687 .. versionadded:: 3008.2
688
689 CLI Examples:
690
691 .. code-block:: bash
692
693 salt '*' pillar.ext '{libvirt: _}'

Callers

nothing calls this directly

Calls 4

get_pillarMethod · 0.45
valueMethod · 0.45
compile_pillarMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected