title: How to use variable in different playbook?
body: <p>How to use a variable in a different playbook? (ansible 2.7.10)</p>
  
  <p><strong>username.yml</strong></p>
  
  <pre><code>- hosts: host
    vars_prompt:
      - name: username
        prompt: 'Username...'
        private: no
    tasks:
    - name: Show username
      debug:
        msg: "{{username}}"
  
  - import_playbook: dns.yml
  </code></pre>
  
  <p><strong>dns.yml</strong></p>
  
  <pre><code>- hosts: DNS
    tasks:
      - name: Mesaj
        debug:
           msg: "{{username}}"
  </code></pre>
  
  <blockquote>
    <p>FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'username' is undefined</p>
  </blockquote>