Skip to content

quote

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 2.10.

Synopsis

  • Quote a string to safely use as in a POSIX shell.

Parameters

Parameter Defaults / Choices Comments
_input
str
required
String to quote.

Notes

Note

  • This is a passthrough to Python's C(shlex.quote).

Examples

- name: Run a shell command
  shell: echo {{ string_value | quote }}

Return Values

Key Data Type Description Returned
_value str Quoted string.