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

Configuring the HTTP_JSON ext_pillar

Set the following Salt config to setup http json result as external pillar source:

  - http_json:
      namespace: 'subkey'
      username: username
      password: password
      header_dict: None
      auth: None

You can pass additional parameters, they will be added to the http.query call utils.http.query function:

Changed in version 3006.0: If namespace is defined, the data will be added under the specified subkeys in the Pillar structure.

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.

  - http_json:
      with_grains: True

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

  - http_json:

Module Documentation

salt.pillar.http_json.ext_pillar(minion_id, pillar, url, with_grains=False, header_dict=None, auth=None, username=None, password=None, namespace=None)

Read pillar data from HTTP response.

  • url (str) -- Url to request.

  • with_grains (bool) -- Whether to substitute strings in the url with their grain values.

  • header_dict (dict) -- Extra headers to send

  • auth -- special auth if needed

  • username (str) -- username for auth

  • pasword (str) -- password for auth

  • namespace (str) -- (Optional) A pillar key to namespace the values under. .. versionadded:: 3006.0


A dictionary of the pillar data to add.

Return type: