Skip to content

salt rendering #129

Open
Open
@srikanth-2

Description

@srikanth-2

I am experiencing an issue when trying to assign a value(icinga_ticket) on my post http query request.
Have the fqdn value set from grain

Below is how it is defined in my state

{% set fqdn = salt'grains.get' %}
{% set icinga_ticket = salt['http.query']('https://ticket-generator.az.dev.opd.com', method='POST', header_dict='{"Content-Type":"application/json"}', data='{"hostname": {{ fqdn }} }', backend='requests') %}

Error:
Rendering SLS 'base:icinga.icinga2_core' failed: Jinja error: 'str' object does not support item assignment
Traceback (most recent call last):

But when i execute the below command through cli it works fine.

salt-call http.query https://ticket-generator.az.dev.opd.com method=POST header_dict='{"Content-Type":"application/json"}' data="'{"hostname": "minion.node.dev.opd.com"}'" backend=requests
local:
----------
body:
{"icinga_ticket":"7609f6bc84d97748e15df9436aab07fbf48756d3"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions