8000 Deprecated 'include' used in Ansible playbooks – should use import_tasks or include_tasks · Issue #1 · regex-33/Security-Engineer-Toolkit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Deprecated 'include' used in Ansible playbooks – should use import_tasks or include_tasks #1
Closed
@sachinn403

Description

@sachinn403

Summary

The current Ansible playbooks in this repository use the deprecated - include: directive, which has been removed in recent versions of Ansible. This results in the following error during execution:

[ERROR]: The 'ansible.builtin.include' action plugin has been removed. Use include_tasks or import_tasks instead.

Files Affected

Examples include:

  • roles/customize-browser/tasks/main.yml
  • roles/install-tools/tasks/main.yml

Suggested Fix

Replace all instances of:

- include: somefile.yml

With either:

- import_tasks: somefile.yml

Or, if you're using when, tags, or need runtime flexibility:

- include_tasks: somefile.yml

Command Used to Fix

find . -type f -name "*.yml" -exec sed -i 's/^[[:space:]]*- include:/- import_tasks:/g' {} +

⚠️ Please manually review files that use when: conditions to decide between import_tasks and include_tasks.


Additional Context

This change is necessary for compatibility with Ansible versions released after May 2023 and to ensure future stability.

Let me know if you'd like me to open a pull request for this fix!


Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0