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

Use import_playbook instead of include #61

Open
dahorak opened this issue Nov 10, 2017 · 6 comments
Open

Use import_playbook instead of include #61

dahorak opened this issue Nov 10, 2017 · 6 comments
Milestone

Comments

@dahorak
Copy link
Contributor

dahorak commented Nov 10, 2017

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>>
@mbukatov mbukatov added this to the changes_for_v1.5.5 milestone Nov 25, 2017
@mbukatov mbukatov self-assigned this Nov 25, 2017
@mbukatov
Copy link
Collaborator

mbukatov commented Nov 25, 2017

Accepting this feature for future upstream release 1.5.5

@mbukatov mbukatov removed this from the changes_for_v1.5.5 milestone Feb 16, 2018
@mbukatov
Copy link
Collaborator

mbukatov commented Mar 4, 2018

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.

@mbukatov mbukatov assigned dahorak and unassigned mbukatov Mar 27, 2018
@mbukatov
Copy link
Collaborator

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

@mbukatov
Copy link
Collaborator

Ansible 2.6 no longer complains about this. Eh.

@mbukatov
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants