0

I want to print {{ in markdown.

This is a sample ansible script that I want to display in my blog.

- hosts: all
  remote_user: ubuntu
  become: True
  become_method: sudo
  become_user: root

  tasks:
    - name: Add user
      user:
          name="{{ user }}"
          shell=/bin/bash
          state=present
          groups=staff
          append=yes
          createhome=yes

But when I render in browser, it shows

- hosts: all
  remote_user: ubuntu
  become: True
  become_method: sudo
  become_user: root

  tasks:
    - name: Add user
      user:
          name=""
          shell=/bin/bash
          state=present
          groups=staff
          append=yes
          createhome=yes

If you see that, the name is not printing with {{ user }} but just "". Is there a way to print {{ }} ?

advishnuprasad
  • 341
  • 1
  • 6
  • 18
  • Possible duplicate of [How to escape {{ in markdown on Octopress?](http://stackoverflow.com/questions/15786144/how-to-escape-in-markdown-on-octopress) or [Escaping double curly braces inside a markdown code block in Jekyll](http://stackoverflow.com/questions/24102498/escaping-double-curly-braces-inside-a-markdown-code-block-in-jekyll) – Amadan Mar 29 '16 at 04:31

1 Answers1

4

In a code block, you mean? Yes, it does.

"{% raw %} {{ user}} {% endraw %}"

Should do the job.

Hope to have helped! :)

Virtua Creative
  • 2,025
  • 1
  • 13
  • 18