title: How to set multiple variables to be used in an ansible task using local commands
body: <p>I have a deployment playbook and I want to see some info of the artifact being deployed. For that I created the following task</p>
  
  <pre><code>- name: Print application info
    debug:
      msg: "Version to be deployed is {{ app_version }} built on {{ app_build_date }}. Jar md5 is {{ app_md5 }}"
      verbosity: 1
  </code></pre>
  
  <p>What is the best way to define the value of all those variables? The artifact to be deployed is locally accessible in the control node. I don't want to have to create one task to set (register) each variable via the <code>command</code> module. I also looked into local facts but IIUC, that means I would need to create another separate play to gather the facts, plus the solution is not self-contained since I would need to manage local files in <code>/etc/ansible/facts.d</code> in the control node outside of ansible's control.</p>
  
  <p>Is there a way that is self-contained/managed by ansible? </p>