Lots of new stuff

Hi all,

Various commits this morning and last night that should be interesting, and might not make sense on their own:

  • There’s now a “template” module that can transfer files and template them through use of Jinja2. Requires jinja2 to be on the client, but only if you use tempting. See playbook.yml for usage.

  • There’s now a “setup” module which can be used to push key/value data onto the system in JSON. Primarily, this is for templates, but I can also see that some modules could maybe use it for defaults (like command timeouts?). Values get written to /etc/ansible/setup, which presumably should be a parameter if you’re templating something as non-root and can’t write to that, but I’ll leave that for later – until then, not root? No templates for you yet. I’ll file something in github’s tracker about that.

  • I’ve implemented md5sum capability for both copyfile and template, so the playbook functionality can trigger change events, allowing Puppet-like triggers. It does not currently chose to not overwrite the file if there would be no change, but this is a minor tweak to do. It’s not smart enough to be able to “notify”
    other tasks, like only run them if they are triggered. This can be added to playbooks later and will probably mean the “on change” section goes away and becomes something on the same level as tasks.

  • I’ve made simplifications to the “examples/playbook.yml” format to make it easier to read/write by humans.

  • When forks is set to 1, the multiprocessing module is not used, allowing for easier tracebacks in development when working in things called by _executor_hook

  • As of last night, there’s also an Ohai module. These are currently NOT accessible by Jinja2 tempting, but it might be cool if the template module also knew to exec facter/ohai if they existed to make those variables available. I’ll file a github ticket about that idea as it’s pretty easy to do. (And probably move the rest of the ideas into the tracker).

Sidenote – I may try to get the system to reuse SSH connections between commands in the playbook as it’s currently closing them each time, which limits speed a small amount.

(Incidentally, ignore the linearity of the commit history on github – my VM clock’s was way off – will be fixed for future commits)

–Michael