Ansible 2.0.0 alpha is ready for testing!

Hi all, I’m proud to announce that Ansible 2.0 alpha1 is available for download and testing today!

This alpha release is the culmination of many months of work to not only refactor the code base to increase stability, but to add some amazing new features:

  • Blocks, which allow playbooks to do some basic try/except/finally style error handling
    http://docs.ansible.com/ansible/playbooks_blocks.html
  • Execution strategy plugins, which allow tasks to run in ways that differ from classic Ansible.
    https://docs.ansible.com/ansible/playbooks_strategies.html
  • Dynamic include statements, which bring back the ability to use include + with_* loops. In
    1.9.x and before, includes function simply as a pre-processor macro, in which tasks are
    expanded before any task execution starts. Now, in 2.0 and beyond, includes are executed
    as any other task is and expanded only at the point it is executed.
  • A multitude of bug fixes - well over 200 issues were closed in just the main Ansible repository
    as part of the refactoring and cleanup.
  • Over 140 new modules, including the new style Openstack modules, new VMware and
    Cloudstack modules, and many more!

The full list of changes can be found here:

https://github.com/ansible/ansible/blob/devel/CHANGELOG.md

One thing you might notice is the release name - as of the 2.0 release we will now be tracking Led Zeppelin songs, with the first release being “Over the Hills and Far Away”. Michael and I had discussed this all the way back in December of 2014, so it’s nice being able to make it official :slight_smile:

What will break?

Does this mean v1 stuff is gone from devel branch?

First, rewinding head to replay your work on top of it…
warning: unable to rmdir v1/ansible/modules/core: Directory not empty
warning: unable to rmdir v1/ansible/modules/extras: Directory not empty

This is from my normal git clone via

git pull --rebase
git submodule update --init --recursive

And not the above clone/checkout.

yes

Any plans to expand docs.ansible.com to include the new v2 functionality such as try blocks and similar? The only documentation I’ve seen so far is from a few slideshare prezos…

It's been there for weeks now, e.g.:

http://docs.ansible.com/ansible/playbooks_blocks.html

-- Abhijit

You mean like https://docs.ansible.com/ansible/playbooks_blocks.html ?

There was talk of it being changed to a more pythonic way and use try: except: finally: and so on ? Was that dropped ?

Regards,
Alex

Hi,

I tried to make some tests but it looks like ansible galaxy is broken for now

caracal:ansible (devel*) $ source hacking/env-setup
running egg_info
creating lib/ansible.egg-info
writing requirements to lib/ansible.egg-info/requires.txt
writing lib/ansible.egg-info/PKG-INFO
writing top-level names to lib/ansible.egg-info/top_level.txt
writing dependency_links to lib/ansible.egg-info/dependency_links.txt
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'v2'
no previously-included directories found matching 'docsite'
no previously-included directories found matching 'ticket_stubs'
no previously-included directories found matching 'packaging'
no previously-included directories found matching 'test'
no previously-included directories found matching 'hacking'
warning: no files found matching 'contrib/inventory'
no previously-included directories found matching
'lib/ansible/modules/core/.git'
no previously-included directories found matching
'lib/ansible/modules/extras/.git'
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'

Setting up Ansible to run out of checkout...

PATH=/Users/haad/Desktop/ansible-repos/ansible/bin:/Users/haad/.pythonz/bin:/Users/haad/.rvm/gems/ruby-2.1.1/bin:/Users/haad/.rvm/gems/ruby-2.1.1@global/bin:/Users/haad/.rvm/rubies/ruby-2.1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/haad/.rvm/bin
PYTHONPATH=/Users/haad/Desktop/ansible-repos/ansible/lib:
MANPATH=/Users/haad/Desktop/ansible-repos/ansible/docs/man:

Remember, you may wish to specify your host file with -i

Done!

caracal:ansible (devel*) $ rm -rf /tmp/roles; ansible-galaxy install
-vvvvvv aeriscloud.dynamodb -p /tmp/roles
Using /Users/haad/.ansible.cfg as config file
Base API: https://galaxy.ansible.com/api/v1
96210 1441010353.70632: Installing role aeriscloud.dynamodb from
/tmp/roles/aeriscloud.dynamodb
- downloading role 'dynamodb', owned by aeriscloud
- https://galaxy.ansible.com/api/v1/roles/?owner__username=aeriscloud&name=dynamodb
- downloading role from
https://github.com/AerisCloud/ansible-dynamodb/archive/v1.0.0.tar.gz
- extracting aeriscloud.dynamodb to /tmp/roles/aeriscloud.dynamodb
- aeriscloud.dynamodb was installed successfully
96210 1441010355.68532: Installing dep aeriscloud.yum
Unexpected Exception: 'module' object has no attribute 'role_spec_parse'
the full traceback was:

Traceback (most recent call last):
  File "/Users/haad/Desktop/ansible-repos/ansible/bin/ansible-galaxy",
line 79, in <module>
    sys.exit(cli.run())
  File "/Users/haad/Desktop/ansible-repos/ansible/lib/ansible/cli/galaxy.py",
line 125, in run
    self.execute()
  File "/Users/haad/Desktop/ansible-repos/ansible/lib/ansible/cli/__init__.py",
line 97, in execute
    fn()
  File "/Users/haad/Desktop/ansible-repos/ansible/lib/ansible/cli/galaxy.py",
line 454, in execute_install
    dep = ansible.utils.role_spec_parse(dep)
AttributeError: 'module' object has no attribute 'role_spec_parse'

This happens on devel branch.

Yes, we decided to stick with the block/rescue/always syntax so as not to confuse things, and it does make things a bit easier internally to python to not use reserved keywords for variable names.