salt.pillar.http_yaml module

A module that adds data to the Pillar structure retrieved by an http request

Configuring the HTTP_YAML ext_pillar

Set the following Salt config to setup an http endpoint as the external pillar source:

ext_pillar:
  - http_yaml:
      url: http://example.com/api/minion_id
      ::TODO::
      username: username
      password: password

If the with_grains parameter is set, grain keys wrapped in can be provided (wrapped in <> brackets) in the url in order to populate pillar data based on the grain value.

ext_pillar:
  - http_yaml:
      url: http://example.com/api/<nodename>
      with_grains: True

Changed in version Oxygen: If %s is present in the url, it will be automaticaly replaced by the minion_id:

ext_pillar:
  - http_json:
      url: http://example.com/api/%s

Module Documentation

salt.pillar.http_yaml.ext_pillar(minion_id, pillar, url, with_grains=False)

Read pillar data from HTTP response.

Parameters:
  • url (str) -- Url to request.
  • with_grains (bool) -- Whether to substitute strings in the url with their grain values.
Returns:

A dictionary of the pillar data to add.

Return type:

dict