title: ansible playbook shell module escaping special characters
body: <p>Using in an ansible playbook for ansible 2.4.2.0</p>
  
  <pre><code>- name: Check the Tomcat version
    shell: "unzip -c {{ mount_path_instance }}/tomcat9/lib/catalina.jar META-INF/MANIFEST.MF |awk '/Implementation-Version: / {sub(/[^ ]+ /, \"\"); print \$0}'"
    register: tomcat_version
    when: instance_check_v9.stat.exists
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>TASK [redhat-tomcat-update : include_tasks] ************************************
  fatal: [localhost]: FAILED! =&gt; {"reason": "Syntax Error while loading YAML.\n\n\nThe error appears to have been in '/home/ansible/work/play_redhat_tomcat_update/roles/redhat-tomcat-update/tasks/variables.yml': line 39, column 153, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- name: Check the Tomcat version\n  shell: \"unzip -c {{ mount_path_instance }}/tomcat9/lib/catalina.jar META-INF/MANIFEST.MF |awk '/Implementation-Version: / {sub(/[^ ]+ /, \\\"\\\"); print \\$0}'\"\n                                                                                                                                                        ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n\nexception type: &lt;class 'yaml.scanner.ScannerError'&gt;\nexception: while parsing a quoted scalar\n  in \"&lt;unicode string&gt;\", line 39, column 10\nfound unknown escape character\n  in \"&lt;unicode string&gt;\", line 39, column 153"}
  </code></pre>
  
  <p>running the next command works fine</p>
  
  <pre><code>ansible localhost -m shell -a "unzip -c {{ mount_path_instance }}/tomcat9/lib/catalina.jar META-INF/MANIFEST.MF |awk '/Implementation-Version: / {sub(/[^ ]+ /, \"\"); print \$0}'" --extra-vars='{"mount_path_instance": "/appl/tomcat/paul_1_uat", "instance_name": "paul_1_uat" }'
  </code></pre>
  
  <p>[WARNING]: Consider using unarchive module rather than running unzip</p>
  
  <p>localhost | SUCCESS | rc=0 >>
  9.0.7.redhat-12</p>
  
  <p>does some one see what is wrong in the yml definition?</p>