# Playbook's --extra-vars reinstated on the devel branch

**URL:** <https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461>\
**Category:** Ansible Project\
**Created:** [April 26, 2012, 11:59pm UTC](https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461 "2012-04-26T23:59:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [April 26, 2012, 11:59pm UTC](https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461/1 "2012-04-26T23:59:41Z")

</div>

Back by popular demand, a much simpler implementation of --extra-vars

This allows things like:

&nbsp;&nbsp;ansible-playbook release-any-version-of-my-app.yml  
--extra-vars="version=123 favcolor=red"

And to be able to use those variables inside the playbook without  
having to edit the playbook.

---

<div class="post-metadata">

**Author:** ![Matthew\_Williams](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Matthew\_Williams](https://forum.ansible.com/u/Matthew_Williams)\
**Post date:** [April 27, 2012, 12:06am UTC](https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461/2 "2012-04-27T00:06:32Z")

</div>

Are extra-vars once again available to the inventory script as well? I  
don't know that I need that anymore, just asking.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [April 27, 2012, 12:48am UTC](https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461/3 "2012-04-27T00:48:21Z")

</div>

> Are extra-vars once again available to the inventory script as well? I don’t know that I need that anymore, just asking.

No, they don’t. Use environment variables if you need to pass anything to your external host script.

---

<div class="post-metadata">

**Author:** ![Art\_Zemon](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Art\_Zemon](https://forum.ansible.com/u/Art_Zemon)\
**Post date:** [April 27, 2012, 3:51am UTC](https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461/4 "2012-04-27T03:51:41Z")

</div>

Thank you! We will need this for passing things like license keys to hosts  
as we provision them.

-- Art Z.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [April 27, 2012, 12:08pm UTC](https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461/5 "2012-04-27T12:08:31Z")

</div>

If you are sending license keys to hosts, it might be better to switch to the new YAML inventory format, and keep them as a per-host variable, and you could keep the license key with each host, if they differed, that way you have a record of it and can easily reinstall them.

[http://ansible.github.com/patterns.html#advanced-inventory-file-format](http://ansible.github.com/patterns.html#advanced-inventory-file-format)

–Michael

---

<div class="post-metadata">

**Author:** ![Art\_Zemon](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Art\_Zemon](https://forum.ansible.com/u/Art_Zemon)\
**Post date:** [April 27, 2012, 6:11pm UTC](https://forum.ansible.com/t/playbooks-extra-vars-reinstated-on-the-devel-branch/11461/6 "2012-04-27T18:11:19Z")

</div>

Michael,

The YAML format looks cool. I don’t think we will need it but we are so early in our project that I could well be wrong.

We don’t need to use the inventory files as a record-keeping facility. We have good tools in place to match license keys to hosts. For this particular issue, we just need to pass the license number to the script which runs on the server which installs the backup software.

We may get to the point of using ansible to assure that the software’s XML config file has the right license key in the right line but (despite my previous messages about it) I try very hard to avoid managing server configs down to individual lines within mostly-unmanaged files. That is a PITA, as you well know.

We are using ansible for two efforts:

1. As a puppet-replacement, to assure that a set of files gets distributed to all servers and that they stay “in sync” with the master copy.
2. As a tool for provisioning new servers

If my questions and suggestions seem schizophrenic, it is because the two projects only overlap a little bit.

– Art Z.
