title: Ansible: How to add variables to "command" or "shell"
body: <p>Is it possible to use variables on <code>command</code> or <code>shell</code> modules?
  I have the following code, and I would like to use variable file to provide some configurations:</p>
  
  <p>I would like to read the Hadoop version from my variables file. On other modules of ansible I could use <code>{{ansible_version}}</code>, but with command or shell it doesn't works.</p>
  
  <pre><code>- name: start ZooKeeper HA
    command: hadoop-2.7.1/bin/hdfs zkfc -formatZK -nonInteractive
  
  - name: start zkfc
    shell: hadoop-2.7.1/sbin/hadoop-daemon.sh start zkfc
  </code></pre>
  
  <p>I would like to convert to the following:</p>
  
  <pre><code>- name: Iniciar zkfc
    command: {{ hadoop_version }}/sbin/hadoop-daemon.sh start zkfc
  </code></pre>
  
  <p>Because if I run the with this syntax it throws this error:</p>
  
  <pre><code>- name: inicializar estado ZooKeeper HA
    command: {{hadoop_version}}/bin/hdfs zkfc -formatZK -nonInteractive
                               ^ here
  We could be wrong, but this one looks like it might be an issue with
  missing quotes.  Always quote template expression brackets when they
  start a value. For instance:
  
      with_items:
        - {{ foo }}
  
  Should be written as:
  
      with_items:
        - "{{ foo }}"
  </code></pre>
  
  <p>I have try using, but same problem:</p>
  
  <pre><code>- name: Iniciar zkfc
    command: "{{ hadoop_version }}"/sbin/hadoop-daemon.sh start zkfc
  </code></pre>
  
  <p>What is the correct syntax?</p>