Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible 2.4+ deprecation warnings #190

Closed
arm4b opened this issue Mar 28, 2018 · 9 comments · Fixed by #215
Closed

Ansible 2.4+ deprecation warnings #190

arm4b opened this issue Mar 28, 2018 · 9 comments · Fixed by #215

Comments

@arm4b
Copy link
Member

arm4b commented Mar 28, 2018

Fix Ansible deprecation warnings starting to appear since Ansible 2.4:

[DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. Use 
'import_tasks' for static inclusions or 'include_tasks' for dynamic inclusions.
 This feature will be removed in a future release. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: include is kept for backwards compatibility but usage is
 discouraged. The module documentation details page may explain more about this
 rationale.. This feature will be removed in a future release. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
@cognifloyd
Copy link
Member

import_tasks and include_tasks require ansible 2.4 and up.
include was set to be deprecated in ansible 2.8, but that has been delayed:

defering deprecation until we are comfortable that the new actions
cover most of the ground users need.

If we're ready to require ansible 2.4 minimum then we can get rid of the deprecation notices. I would love to require ansible 2.4 as I already require it for the playbooks I write. But, I don't know if that would be a generally acceptable requirement yet.

@arm4b
Copy link
Member Author

arm4b commented Mar 29, 2018

@cognifloyd That's a perfectly valid point, agree with you 👍

So yeah, Ansible 2.5 is just out.
Considering that currently we set minimum 2.2 requirement in roles, probably pumping requirements to 2.4 would be too much an aggressive move.

Will wait for a couple of Ansible releases for things to settle down and users move to new versions, before making this change.

@arm4b arm4b added enhancement and removed bug labels Mar 29, 2018
@cognifloyd
Copy link
Member

cognifloyd commented Jul 3, 2018

🎉 Ansible 2.7 is here. https://groups.google.com/forum/#!topic/ansible-announce/fx7nxwL4hMM

2.6 had lots of bugfixes for include* and import*.
2.7 makes using vars with include* and import* more consistent.

Current ansible support matrix for 2.2 and above: edit: updated on 2018-10-05

Ansible Release Latest Version Status
devel 2.8 (unreleased, trunk) In development
2.7 2.7.0 (2018-10-04) Supported (security and general bugfixes)
2.6 2.6.1 (2018-09-28) Supported (security and critical bugfixes)
2.5 2.5.6 (2018-09-10) Supported (security fixes)
2.4 2.4.6 (2018-07-05) Unsupported (end of life)
2.3 2.3.3 (2017-12-20) Unsupported (end of life)
2.2 2.2.3 (2017-05-09) Unsupported (end of life)

2.8 is expected Q1 2019.

So, I'd love to bump the minimum if that's ok. How high can we push it? If not now, when?

@LindsayHill
Copy link
Contributor

See
#211 (comment) - I think we should be bumping to min 2.5

@cognifloyd
Copy link
Member

cognifloyd commented Oct 26, 2018

Excellent. I will submit a PR this weekend bumping to 2.5 and getting rid of these deprecation notices :)
edit: I ended up digging into orquesta instead of finishing this. I'm planning to use this exercise to teach a new guy to upgrade Ansible roles sometime this week.

@LindsayHill
Copy link
Contributor

Good stuff. Looks like it's also time for us to tag another release? 0.9.0 maybe?

@arm4b
Copy link
Member Author

arm4b commented Oct 26, 2018

Yep, the plan is also to include #207 (both feature and fix) in that upcoming v0.9.0 release.

@arm4b
Copy link
Member Author

arm4b commented Oct 27, 2018

Alright, I've finished #207 to fix the build.
Will wait for @cognifloyd to include the changes with min Ansible version and deprecation notices and we can release the new version early next week.

@arm4b
Copy link
Member Author

arm4b commented Oct 29, 2018

I've released https://github.com/StackStorm/ansible-st2/releases/tag/v0.9.0 as there were really enough of other unreleased changes. For better convenience, that will be last release supporting old Ansible v2.3 so people could pin to it if they want.

I'm good if we bump min Ansible to v2.5 and call it next dedicated release (which could be done anytime ASAP) so @cognifloyd if you want to look at those changes, - that would be welcomed 👍

Having this Ansible transition tagged as a new release I think would be better and easier for us & community.

cognifloyd pushed a commit to theatro/ansible-st2 that referenced this issue Nov 10, 2018
Replaces static includes with import_tasks (partially resolves StackStorm#190).
cognifloyd pushed a commit to theatro/ansible-st2 that referenced this issue Nov 10, 2018
Replaces dynamic includes with include_tasks (resolves StackStorm#190).

include_tasks (introduced in Ansible 2.4) does not support ansible 1.x
style inline vars syntax (var=value) (since at least Ansible 2.4.1)[1].
If the syntax ever worked, removing support for it was announced in the
Ansible 2.7 Porting Guide[2]. So, this modifies include loops to be
include_tasks loops using the `vars` key instead of the inline syntax.

[1] ansible/ansible#32812
[2] https://docs.ansible.com/ansible/2.7/porting_guides/porting_guide_2.7.html#include-tasks-import-tasks-inline-variables
cognifloyd pushed a commit to theatro/ansible-st2 that referenced this issue Nov 13, 2018
Replaces dynamic includes with include_tasks (resolves StackStorm#190).

include_tasks (introduced in Ansible 2.4) does not support ansible 1.x
style inline vars syntax (var=value) (since at least Ansible 2.4.1)[1].
If the syntax ever worked, removing support for it was announced in the
Ansible 2.7 Porting Guide[2]. So, this modifies include loops to be
include_tasks loops using the `vars` key instead of the inline syntax.

[1] ansible/ansible#32812
[2] https://docs.ansible.com/ansible/2.7/porting_guides/porting_guide_2.7.html#include-tasks-import-tasks-inline-variables
arm4b pushed a commit that referenced this issue Dec 18, 2018
Port to minimum of Ansible 2.5 (resolves #190)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants