ansible / ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com.
https://www.ansible.com/
GNU General Public License v3.0
62.97k stars 23.91k forks source link

[DEPRECATION WARNING]: 'include' for playbook includes. You should use 'import_playbook' #55143

Closed flysen closed 5 years ago

flysen commented 5 years ago
SUMMARY

Running playbooks that uses include statement gives me a warning: [DEPRECATION WARNING]: 'include' for playbook includes. You should use 'import_playbook' Running playbook that uses roles (which use include instead of import_tasks) doesn't throw any warnings.

ISSUE TYPE
COMPONENT NAME

Documentation

# roles/example/tasks/main.yml
- name: added in 2.4, previouslly you used 'include'
  import_tasks: redhat.yml
  when: ansible_os_platform|lower == 'redhat'
- import_tasks: debian.yml
  when: ansible_os_platform|lower == 'debian'

I expect to get DEPRECATION WARNING warnings for this code:

# roles/example/tasks/main.yml
- name: used include in role no deprecated warnings
  include: redhat.yml
  when: ansible_os_platform|lower == 'redhat'
- include: debian.yml
  when: ansible_os_platform|lower == 'debian'
ANSIBLE VERSION
ansible 2.6.3
  config file = /ansible-dev/tsap/kafka/ansible.cfg
  configured module search path = [u'/ansible-dev/tsap/kafka/library']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
ansibot commented 5 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibot commented 5 years ago

cc @Java1Guy @Shaps @akazakov @alikins @barnabycourt @kahowell @linuxdynasty @lwade @mattclay @ryansb @ryansydnor @s-hertel @tima @willthames @wimnat @yaakov-github click here for bot help

ansibot commented 5 years ago

@flysen, just so you are aware we have a dedicated Working Group for aws. You can find other people interested in this in #ansible-aws on Freenode IRC For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

sivel commented 5 years ago

This warning is not coming from a role. This warning would only be generated if you have a playbook that does something like this:

playbook.yml

- include: some_other_playbook.yml

This warning is not caused from including a task file, only for including another playbook.

flysen commented 5 years ago

This warning is not coming from a role. This warning would only be generated if you have a playbook that does something like this:

playbook.yml

- include: some_other_playbook.yml

This warning is not caused from including a task file, only for including another playbook.

@sivel Thanks for prompt reply, So if i have a role: roles/example/tasks/main.yml I can continue to use include to include tasks. I don't need to change to import_tasks? Regards Fredrik

sivel commented 5 years ago

Yes, you can still continue to use include for including tasks files for now. include for task files is not deprecated at this time.

If you have further questions please stop by IRC or the mailing list: