mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #42560 from ArcaniteSolutions/improve_http_json_and_yaml
pillar/http_json and yaml: replace %s with minion_id in urls
This commit is contained in:
commit
9f0a64a137
2 changed files with 26 additions and 0 deletions
|
@ -27,6 +27,16 @@ in <> brackets) in the url in order to populate pillar data based on the grain v
|
|||
url: http://example.com/api/<nodename>
|
||||
with_grains: True
|
||||
|
||||
.. versionchanged:: Oxygen
|
||||
|
||||
If %s is present in the url, it will be automaticaly replaced by the minion_id:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
ext_pillar:
|
||||
- http_json:
|
||||
url: http://example.com/api/%s
|
||||
|
||||
Module Documentation
|
||||
====================
|
||||
'''
|
||||
|
@ -64,6 +74,9 @@ def ext_pillar(minion_id,
|
|||
:return: A dictionary of the pillar data to add.
|
||||
:rtype: dict
|
||||
'''
|
||||
|
||||
url = url.replace('%s', _quote(minion_id))
|
||||
|
||||
grain_pattern = r'<(?P<grain_name>.*?)>'
|
||||
|
||||
if with_grains:
|
||||
|
|
|
@ -27,6 +27,16 @@ in <> brackets) in the url in order to populate pillar data based on the grain v
|
|||
url: http://example.com/api/<nodename>
|
||||
with_grains: True
|
||||
|
||||
.. versionchanged:: Oxygen
|
||||
|
||||
If %s is present in the url, it will be automaticaly replaced by the minion_id:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
ext_pillar:
|
||||
- http_json:
|
||||
url: http://example.com/api/%s
|
||||
|
||||
Module Documentation
|
||||
====================
|
||||
'''
|
||||
|
@ -65,6 +75,9 @@ def ext_pillar(minion_id,
|
|||
:return: A dictionary of the pillar data to add.
|
||||
:rtype: dict
|
||||
'''
|
||||
|
||||
url = url.replace('%s', _quote(minion_id))
|
||||
|
||||
grain_pattern = r'<(?P<grain_name>.*?)>'
|
||||
|
||||
if with_grains:
|
||||
|
|
Loading…
Add table
Reference in a new issue