Ansible 2.0, the major code rewrite of the open-source IT automation and configuration-management platform, is on track for a July release.
The coming code refactoring milestone to the technology, which moved to a development branch on June 1, will implement a host of new features and updates focusing on modularity, better object-oriented programming (OOP) and customizability. Components such as YAML parsing were overhauled to add more classes and general-purpose OOP functionality.
(Related: Highlights from last year’s AnsibleFest)
At AnsibleFest NYC, Ansible CTO Tim Gerla said Ansible has become an equalizing technology, and he talked about how the 2.0 codebase represents a mature point where the community and contributors can become the stewards of Ansible.
“Now that we’ve gotten this refactoring out of the way, we don’t want to break anybody’s playbooks,” said Gerla. “At this point, Ansible is really stable and mature, and the community approach—especially in Ansible’s modules—are crucial, and we’re working on anything we can do to remove any kind of funneling restrictions on those contributions going forward.”
James Cammarata, Ansible’s director of core engineering, ran down the major new features and changes in Ansible 2.0 as part of a concerted effort to ensure 100% backward compatibility with Ansible playbooks. One of the biggest new features he mentioned was blocks.
Allowing for easier grouping of related tasks, blocks in Ansible 2.0 are a method for catching errors during task execution. Blocks enable try/except handling, Cammarata said, giving developers the ability to execute a set of tasks regardless of whether an exception has occurred, and to execute code cleanup at the end of a deployment.
Ansible 2.0 also rolls out a new execution strategy. Developers will be able to combine the traditional linear strategy of waiting for a host to complete all tasks with a new free strategy of running through task lists as fast as possible. The strategies exist as a playbook-level setting and, as Cammarata explained, act essentially as plug-ins.
“These are Ansible plug-ins,” he said. “A lot of the functionality in Ansible is based on plug-ins, and this is just another type you can write.”
Other noteworthy features in Ansible 2.0 include a dynamic “Include+” action for task evaluation, a new VariableManager class to better control the order and source of variables, and improved error messages that show any Ansible playbook error—even those unrelated tot syntax—with the file along with the line and column where the error occurred.