Hi all,
We have released Ansible 1.8.0, which adds some exciting new features and modules, as well as many enhancements to cloud modules and other various bug fixes:
-
Fact caching support, pluggable, initially supports Redis (DOCS pending)
-
The new omit value can be used to leave off a parameter when not set, like so module_name: a=1 b={{ c | default(omit) }}, would not pass value for b (not even an empty value) if c was not set.
-
no_log parameter now surpressess data from callbacks/output as well as syslog
-
ansible-galaxy install -f requirements.yml allows advanced options and installs from non-galaxy SCM sources and tarballs.
For developers writing modules:
-
The ‘baby JSON’ support in module responses, originally intended for writing modules in bash, is removed as a feature to simplify logic, script module remains available for running bash scripts.* async jobs started in “fire & forget” mode can now be checked on at a later time.
-
added ability to subcategorize modules for docs.ansible.com
-
added ability for shipped modules to have aliases with symlinks
-
added ability to deprecate older modules by starting with “_” and including “deprecated: message why” in module docs
And much more! Be sure to check the CHANGELOG for a full list of changes and fixes in this release.
This update is available via PyPi and releases.ansible.com now, and packages for distros will be available as soon as possible.
Thanks!
Cool! I’ve got a couple of questions:
For developers writing modules:
- The ‘baby JSON’ support in module responses, originally intended for writing modules in bash, is removed as a feature to simplify logic, script module remains available for running bash scripts.
Does this mean that Ansible always passes JSON to modules (no more # WANT_JSON), or does this mean that Ansible always expects modules to return JSON, or both, or something else?
- added ability for shipped modules to have aliases with symlinks
Nice! Is there a mechanism for proposing aliases upstream? For example, if I wanted to submit an alias for the “quantum_floating_ip” as “neutron_floating_ip”, can I submit a pull request with a symlink? Or is this strictly up to the downstream packages to create these type of symlinks?
Lorin
The question in (A) means that modules must emit json, and key=value pairs one per line are not acceptable module stdout any longer.
The capability of modules to not take JSON for non-Python modules still is around, ergo the WANT_JSON thing is still there. However, I can see this eventually requiring JSON all the time, as most cases of folks wanting to write something in bash can be replaced with the ‘script’ module easily enough.
The question in (B) is … yes, by submitting a github pull request which is a symlink. However – we have more OpenStack renaming planned instead, that will make things more like “os_floating_ip” instead, and stop using some codenames. This is more of an Ansible-devel discussion to an extent, Monty has weighed in with some suggestions on this in the future. We are apt to continue the existing OpenStack modules for some time and deprecate them, and this may result in slightly different and better unified module parameters, and other related things as well.
One last question: When you invoke a script with the ‘script’ module, can it return values? i.e., can I set changed=true/false, or invoke it with a “register” clause?
Lorin
If you run with “-v” you should see all the things the script module returns.
rc/stdout and the usual stuff from command, more or less, IIRC.