title: Use the response from shell inside yml for Ansible playbook
body: <p>I want to install MongoDB via Ansible playbook, I am following the instruction in:
  <a href="https://www.howtoforge.com/tutorial/install-mongodb-on-ubuntu-16.04/" rel="noreferrer">https://www.howtoforge.com/tutorial/install-mongodb-on-ubuntu-16.04/</a></p>
  
  <p>For the step about "Step 2 - Create source list file MongoDB"</p>
  
  <p>I should use:</p>
  
  <pre><code>echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
  </code></pre>
  
  <p>while it get the ubuntu version with the following command: </p>
  
  <pre><code>$(lsb_release -sc)
  </code></pre>
  
  <p>How can I do it via yml file and run it via ansible palybook?
  I used the below yml command but it is not working and gives me error since I use shell command "$(lsb_release -sc)" inside my script </p>
  
  <pre><code>- name: Create source list file MongoDB
    sudo: yes
    lineinfile: &gt;
      line="deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse"
      dest=/etc/apt/sources.list.d/mongodb-org-3.2.list
      state=present
      create=yes
  </code></pre>