> For the complete documentation index, see [llms.txt](https://notes.eliasnorrby.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.eliasnorrby.com/ansible/literal-curly-braces.md).

# Literal curly braces (raw)

Ansible makes heavy use of [Jinja](https://jinja.palletsprojects.com) for templating. Notably, variables can be referenced using double curly braces:

```yaml
name: "{{ app_name }}"
```

If we want to type literal double curly braces, e.g. for use in a `docker` or `podman` format string, we can use a `raw` section:

```yaml
- name: Check if container is running
  command: podman ps -a --filter "name={{ app_name }}" --format "{% raw %}{{.State}}{% endraw %}"
  register: container_state
  changed_when: False
```

`{{ app_name }}` will be replaced with a variable value, while `{{.State}}` won't be.
