1.4 deprecation plan for some very old features that have not been documented for a long time

FYI for 1.4.

Survey data confirmed a lot of people really wanted to see things streamlined and remove the legacy bits, and I agree.

It’s time to remove a lot of legacy “crud” from Ansible as we standardize the syntax and operations
as people do things. Many of these things we added as we grew, and things have sense stabilized very very nicely.

This is the “heads up” that this is coming so we aren’t surprised later, and I think the reaction to this will be largely very positive.

Reason being, nobody should be doing any of these things and they have been undocumented for the last several releases. However, a few old blog posts remain – and it’s occasional that people learn something from a blog post instead of the official docs and examples.

To be able to retire these spots, therefore, the following legacy feature things will emit very noisy warnings in the current 1.4 development release and be removed from 1.5:

  • include when used with “with_items”. It’s super confusing and has barely ever been documented exactly for this reason.
  • when_integer, when_string, etc. Use “when”. These other ones are limited by type and there’s no reason to need to use them.
  • only_if. This was added in 0.9 and almost immediately supplanted. It’s super confusing and very hard to get right. Also use “when”.

The following legacy things will likely be deprecated in 1.5 and removed in 1.6

  • usage of variables like $x instead of {{ x }}. The code around this is particularly fiendish when accessing complex data. This will probably not emit warnings as it’s tricky to do so in a predictable way, and will likely result in legacy_playbook_variables also defaulting to “off” in 1.5 to get people used to things.
  • before we do this, we will provide a nice way to do variable references that keep type information, for instance foo: {{ x }} should allow for passing lists and dictionaries easily to roles, etc. This is why this will not happen for 1.4

To be clear, there is nothing else even on the radar for removal after this – highly unlikely – and we generally take a very very strong stance towards backward compatibility. The above features being removed from the docs led to a ginormous increase in folks being able to use things and find Ansible easy to use, and this is just to prevent the remainder of those questions from blog posts that still come up. These were things that existed as we were arriving at a desired set of language and want to keep playbook changes people need to make on upgrades to an absolute minimum.