Tendrl/tendrl-ansible

Use import_playbook instead of include

dahorak opened this issue · 6 comments

Ansible in version 2.4 consider include statement as deprecated and suggest to to use import_playbook instead.

# ansible-playbook -i inventory.hosts site.yml 
[DEPRECATION WARNING]: 'include' for playbook includes. You should use 'import_playbook' instead. This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[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.

<<truncated>>

Accepting this feature for future upstream release 1.5.5

Hmm, this import_playbook can't be used instead of include:

  • it have to be used at playbook level, not at a tasks level
  • one can't use when with it

I could use include_role, it would be better to check the reason behind these changes first.

@dahorak when you have time, could you check which option (include_tasks vs import_tasks) makes more sense and create a pull request?

Ansible 2.6 no longer complains about this. Eh.

Actually it's still there, next version of ansible won't have include:

[DEPRECATION WARNING]: 'include' for playbook includes. You should use 
'import_playbook' instead. This feature will be removed in version 2.8. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in 
ansible.cfg.