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

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

This allows things like:

  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.

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

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.

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

-- Art Z.

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

–Michael

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.