Hi,

I'm trying to build custom json file like this : 


{
  "client": {
    "subscriptions": {{ sensu_client_subscriptions | to_nice_json }}
{% if sensu_autoderegister %}
    ,"deregister": true,
    "deregistration": {
      "handler": "deregister_client"
    }
{%endif%}
{% if sensu_custom_value %}
   ,{{ sensu_custom_value| to_nice_json  }}
{%endif%}
  }
}

with variable : 
sensu_custom_value:
  disk: 
    warning: "85"
    critical: "90"
  postfix:
    warning: "10"
    critical: "20"

My issue is with {{ sensu_custom_value| to_nice_json  }}
it's produce unwanted (for me) extra bracket  :
   ,{
    "disk": {
        "critical": "90",
        "warning": "85"
    },
    "postfix": {
        "critical": "20",
        "warning": "10"
    }
}


i whould like to have, instead : 
   ,
    "disk": {
        "critical": "90",
        "warning": "85"
    },
    "postfix": {
        "critical": "20",
        "warning": "10"
    }

any idea ? 


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f33f2734-4726-4cd6-a1c9-c69d312a7a6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to