AnsibleNYC Meetup 2016/3/1 – 2.0 

Tim Appnel
tima@ansible.com
Ansible v2.0
2016-03-01 @Yodle

V2: technical debt etc

# Blocks
reduce repetition of 'when'
try/catch / transactional

blocks can be nested (exercise caution)

blocks variable scope - vars for a block are scoped only to block

block/rescue/always::try/error block/finally

any_errors_fatal: true - throw all the way out.

# improved error messages

# execution strategy plugin (mostly for push)
linear (classic) vs free (each host goes ahead)
strategy at the play level

# execution time evaluation of includes
loops, facts, and variables set during includes would fail
include: users.yml
 vars:
 user: xxx

1.0 was inlining, 2.0 is smarter
include can now be a `include: "{{something}}".yml`

# improved variable management
one shot variable resolution (2.0), instead of piecemeal (1.0)
variable precedence v1:
 1 extra vars
 2 vars, var_files, etc
 3 inventory vars - host vars then group vars
 4 facts
 5 role defaults
2.0:
 1 extra vars
 ...
 16 role defaults

# modules and plugins
over 200 new modules

# cleaner code (OO, etc)
base classes, boo.

# misc
added meta: refresh_inventory - if you create resources it re-creates inventory.

new delegate_facts directive, allows you to apply facts to the delegated host instead of inventory_hostname

# breaking changes
mostly stupid shit you should not do anyways

empty variables and variables set to null in yaml will no longer be converted to empty strings

# 2.0 upgrade
lots of deprecation messages

in general be careful of bare variables
`with_items: foo` string or variable?
guidance: use braces everywhere except in when clauses

stop using sudo/su, instead use `become`
inventory variables don't need _ssh_ `ansible_ssh_hostname` -> `ansible_hostname`

include: xxx
 a: don't do this
include: xxx
 vars:
 a: yes this

# 2.1
expecting more often releases

windows: full time SWEs on windows stuff, will no longer be beta.
network automation support

module --diff support (will take a while for all modules to support this)
what changed?
will it work with --check? maybe? sounds good.

will merge core modules back into main repo (currently submodule)

##
QQ: how many clients do you see in push/pull mode? part of
I mainly see pull mode for when ansible is used to manage puppet or chef. Ansible Tower is the preferred way to go.