JSON Parameter Parsing Error
Symptoms
JSON parameters are not replaced or parsed as expected during the Ansible application deployment.
- Input parameters: {"key":"jsonkey","value":"jsonvalue"}
- Parameters after replacement: {u'value': u'jsonvalue', u'key': u'jsonkey'}
Solution
Enclose JSON parameters with single quotation marks. The template module will forcibly parse the parameters in character string mode to ensure correct replacement. The following is an example:
- Input parameters: '{"key":"jsonkey","value":"jsonvalue"}'
- Parameters after replacement: {"key":"jsonkey","value":"jsonvalue"}
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.