title: How to pass username and ssh password in ansible-playbook command line - Bamboo
body: <p>I have a ansible playbook which I run manually from the command line by <code>ansible-playbook -u &lt;username&gt; -k playbooks/example.yml</code></p>
  
  <p>The above works fine. It prompts me for a SSH password and runs the playbook. </p>
  
  <p><code>The ansible version in my linux machine: 2.7.7</code></p>
  
  <p>I need to run this in Bamboo as part of my build plan. In Bamboo, I cannot type in the password as it will not prompt me. So I want to pass the username and ssh password as part of the command as arguments. </p>
  
  <p>I tried this </p>
  
  <pre><code>ansible-playbook playbooks/monitor-linux-node.yml -e "ansible_user=&lt;username&gt; ansible_ssh_pass=password"
  </code></pre>
  
  <p>This throws this error </p>
  
  <pre><code>ERROR: blockinfile is not a legal parameter in an Ansible task or handler
  </code></pre>
  
  <p>I also tried this</p>
  
  <pre><code>ansible-playbook -u &lt;username&gt; playbooks/monitor-linux-node.yml -e "ansible_ssh_pass=password"
  </code></pre>
  
  <p>This throws the <code>Usage: ansible-playbook playbook.yml</code> and lists the arguments we can use.</p>
  
  <p>Any suggestions on how to pass the username and ssh password in the command line will be really helpful. </p>
  
  <p><code>The ansible version in Bamboo machine: 1.9.4</code></p>