Ansible - JsonArgs Module Type

Card Puncher Data Processing


JsonArgs is a module type. It's a script that contains the following placeholder <<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>> placeholder. During execution, Ansible will replace it with the module parameters.

Process / Dev

  • Create a script with the placeholder <<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>
json_arguments = """<<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>"""
  • Ansible will replace the placeholder with the module parameters in Json format before executing
json_arguments = """{"param1": "test's quotes", "param2": "\"To be or not to be\" - Hamlet"}"""

The Json have the following spec:

  • Double quotes are used to quote string values,
  • double quotes inside of string values are backslash escaped,
  • and single quotes may appear unescaped inside of a string value.

Documentation / Reference

Discover More
Card Puncher Data Processing
Ansible - Module

Module are the component that are called via a task modules_by_category With ansible, example running a module...

Share this page:
Follow us:
Task Runner