Skip to content

Fix deprecated/lint warnings with ansible 2.12+#22

Open
ocroz wants to merge 1 commit intosansible:developfrom
ocroz:develop
Open

Fix deprecated/lint warnings with ansible 2.12+#22
ocroz wants to merge 1 commit intosansible:developfrom
ocroz:develop

Conversation

@ocroz
Copy link

@ocroz ocroz commented Nov 1, 2022

The most annoying with ansible-playbook:

[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks instead.
This feature will be removed in version 2.16.
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

Then with ansible-lint:

# ansible-lint roles/sansible.logrotate/tasks/*

WARNING  Listing 9 violation(s) that are fatal
fqcn[action-core]: Use FQCN for builtin module actions (package).
roles/sansible.logrotate/tasks/build.yml:3 Use `ansible.builtin.package` or `ansible.legacy.package` instead.

fqcn[action-core]: Use FQCN for builtin module actions (template).
roles/sansible.logrotate/tasks/configure.yml:3 Use `ansible.builtin.template` or `ansible.legacy.template` instead.

risky-file-permissions: File permissions unset or incorrect. (warning)
roles/sansible.logrotate/tasks/configure.yml:3 Task/Handler: Configure Application Logs Logrotate Config

fqcn[action-core]: Use FQCN for builtin module actions (template).
roles/sansible.logrotate/tasks/configure.yml:10 Use `ansible.builtin.template` or `ansible.legacy.template` instead.

risky-file-permissions: File permissions unset or incorrect. (warning)
roles/sansible.logrotate/tasks/configure.yml:10 Task/Handler: Configure Custom Logrotate Configs

deprecated-module: Deprecated module. include
roles/sansible.logrotate/tasks/main.yml:3 Task/Handler: Install logrotate

fqcn[action-core]: Use FQCN for builtin module actions (include).
roles/sansible.logrotate/tasks/main.yml:3 Use `ansible.builtin.include` or `ansible.legacy.include` instead.

deprecated-module: Deprecated module. include
roles/sansible.logrotate/tasks/main.yml:8 Task/Handler: Configure logrotate

fqcn[action-core]: Use FQCN for builtin module actions (include).
roles/sansible.logrotate/tasks/main.yml:8 Use `ansible.builtin.include` or `ansible.legacy.include` instead.

You can skip specific rules or tags by adding them to your configuration file:
# .config/ansible-lint.yml
warn_list:  # or 'skip_list' to silence them completely
  - deprecated-module  # Deprecated module.
  - experimental  # all rules tagged as experimental
  - fqcn[action-core]  # Use FQCN for builtin actions.

                              Rule Violation Summary
 count tag                    profile    rule associated tags
     2 deprecated-module      basic      deprecations
     2 risky-file-permissions safety     unpredictability, experimental (warning)
     5 fqcn[action-core]      production formatting

@ocroz
Copy link
Author

ocroz commented Nov 1, 2022

Hello @dennisconrad, or whoever contributor to this project,

I corrected few annoying deprecated and lint warnings that it would be interesting to integrate into a new release.
Nothing prevents this role to function for now. However, I am annoyed by this ansible-playbook warning that pollutes our CI.

Happy to help,
Kind regards,
Olivier

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant