smbambling/ansible-role-scl

Ansible 2.4.0.0 deprecation warnings

leifmadsen opened this issue · 7 comments

Affected Ansible, Python, OS and Role versions/distributions

  • Ansible: 2.4.0.0
  • Python: 2.7.13
  • Distribution: Fedora 26 / CentOS 7
  • Role version: master

How to reproduce (e.g Ansible plybook you used)

Main role.

What are you seeing

[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.

What behaviour did you expect instead

No deprecation warnings :)

Output log

Any additional information you'd like to impart

This would only be an "issue" as of Ansible version 2.8, so there is some time. Perhaps master should be tested against Ansible latest, and then a version tagged here for < 2.4. Or you can ignore this for a while :)

Thanks for reporting this, like you said there is a little bit of time before 2.8 arrives :). I'll take a look into replacing the use of include though.

Yea, the main issue is I'm not sure changing it is backwards compatible, so you'd have to really pin to version > 2.3 which might be a bit annoying, especially as 2.4.0.0 was mostly just released :)

I've created a branch that solves these warning messages and uses the new include_task feature. But this does require Ansible 2.4 or greater. Thus I'll maintain this as a separate branch for a while https://github.com/smbambling/ansible-role-scl/tree/2.4_plus

I'd like to note that the master branch does support 2.4 and 2.5 but does displaying deprecation warnings

This might be mostly safe to release down into a master branch. I'm no longer using this role, but since Ansible 2.5 is out now (and I've had really good luck with 2.4, and it being shipped in a lot of places as either the default in packaging, or even 2.5 default), it might not be a big deal to tag current to an older release, and merge this against master.

Just a thought :)

Thanks for the input / insight, I'll mull over making this change the default and having a legacy branch that supports older/all of the versions with warning.

Did another role take the place of this or did you move off to another project ?

I forget what I was originally using this for, but I'm no longer using SCL, so this role is no longer being utilized. It wasn't replaced with anything else though. I think I found a way to not require SCL any longer.

Cool, thanks for all the info and creating the ticket though!