I'm trying to do an Ansible "when compare string not equals" 

like this :

```
when: "{{ result.stdout }} != '/var'"

```

How do I escape the / in '/var' because it's throwing a :

```
The error was: template error while templating string: unexpected '/'.

```

I have tried escaping the / with a \ but it throws the error :

```
ERROR! Syntax Error while loading YAML.
The offending line appears to be:

shell: rsync -a /var/ "{{ result.stdout }}"
when: "{{ result.stdout }} != '\/var'"
                               ^ here

```

I have tried creating a variable in defaults :

defaults -> main.yml

```
var_partition: /var

```

tasks -> main.yml

```
when: "{{ result.stdout }} != {{ var_partition }}"

```

but it throws the error :

```
"The conditional check '{{ result.stdout }} != {{ var_partition }}' failed. 
The error was: template error while templating string: unexpected '/'. 
String: {% if /disk1 != /var %}

```