title: Vars_prompt in playbooks
body: <p>This is my playbook, </p>
  
  <pre><code>---
  - hosts: alpha
    vars:
    company: vogo
    tasks:
       - name: debugging
         debug:
           msg: "{{ansible_hostname}}"
    vars_prompt:
       - name: "company"
         prompt: "Where do you work"
         private: no
  
  - hosts: webservers
    vars_prompt:
       - name: "fathercompany"
         prompt: "Where your father works"
         private: no
    tasks:
       - name: test
         debug:
           msg: just testing "{{company2}}"
  </code></pre>
  
  <p>Here are the steps of execution flow when I run the playbook, </p>
  
  <p>1 - prompt 1 (Where do you work)</p>
  
  <p>2 - task debugging</p>
  
  <p>3 - prompt 2 (Where your father works)</p>
  
  <p>4 - task test</p>
  
  <p>I have some questions.</p>
  
  <p>First, When I run this playbook, the task "debugging" should run first and then the prompt should ask for the company name. But, when I run this playbook, at the very first step, it asks for "Where do you work ?".
  Why prompt first ?
  Am I missing some kind of paramater which I should have passed ?</p>
  
  <p>Second, I have put 2 prompts here, </p>
  
  <p>I want to use the prompt value <code>company</code>, in the <code>webservers</code> host block. But it gives me error when I try to do that. </p>
  
  <p>Cannot I use the prompt value from one host block into another ?</p>
  
  <p>Third, </p>
  
  <p>How can I use prompts in roles ?</p>