diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 118768c7e8..197612d475 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -41,7 +41,6 @@ jobs: hook docs schemas - eco pre py311-devel py310-lower @@ -110,6 +109,7 @@ jobs: with: path: | .cache/eco + test/fixtures/eco/*/.tox examples/playbooks/collections/ansible_collections ~/.cache/ansible-compat ~/.ansible/collections diff --git a/.gitignore b/.gitignore index 629a9b0c00..107ee6507d 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,4 @@ node_modules .direnv uv.lock .ansible +test/fixtures/eco diff --git a/.gitmodules b/.gitmodules index e69de29bb2..bc01ab0502 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,21 @@ +[submodule "test/fixtures/eco/bootstrap"] + path = test/fixtures/eco/bootstrap + url = https://github.com/robertdebock/ansible-role-bootstrap +[submodule "test/fixtures/eco/cisco.nxos"] + path = test/fixtures/eco/cisco.nxos + url = https://github.com/ansible-collections/cisco.nxos +[submodule "test/fixtures/eco/ansible_collection_system"] + path = test/fixtures/eco/ansible_collection_system + url = https://github.com/devroles/ansible_collection_system +[submodule "test/fixtures/eco/ansible-docker-rootless"] + path = test/fixtures/eco/ansible-docker-rootless + url = https://github.com/konstruktoid/ansible-docker-rootless +[submodule "test/fixtures/eco/ansible-role-hardening"] + path = test/fixtures/eco/ansible-role-hardening + url = https://github.com/konstruktoid/ansible-role-hardening +[submodule "test/fixtures/eco/ansible-role-mysql"] + path = test/fixtures/eco/ansible-role-mysql + url = https://github.com/geerlingguy/ansible-role-mysql.git +[submodule "test/fixtures/eco/debops"] + path = test/fixtures/eco/debops + url = https://github.com/debops/debops diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15562e1f13..9df83b83d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,6 +22,7 @@ exclude: > examples/playbooks/vars/empty.transformed.yml| examples/playbooks/vars/empty.yml| src/ansiblelint/schemas/rulebook.json| + test/fixtures/eco/.*| test/schemas/data/licenses.json| test/schemas/negative_test| test/schemas/package-lock.json diff --git a/codecov.yml b/codecov.yml index ccb3a37e12..077b284a60 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,7 +2,6 @@ comment: false coverage: status: - patch: true + patch: false # avoid false positives project: - default: - threshold: 0.5% + default: true diff --git a/cspell.config.yaml b/cspell.config.yaml index d7cd4c47d9..4fbc32fecd 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -19,6 +19,7 @@ ignorePaths: - docs/requirements.in # Test fixtures generated from outside - test/**/*.result + - test/fixtures/eco/** - src/ansiblelint/schemas/*.json # Other - "*.svg" diff --git a/pyproject.toml b/pyproject.toml index a4b4982685..f64fae3d3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ repository = "https://github.com/ansible/ansible-lint" [tool.codespell] # indention is a typo in ruamel.yaml's API ignore-words-list = "indention" -skip = ".tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata" +skip = ".tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata,test/fixtures/eco/*.json" # Keep this default because xml/report do not know to use load it from config file: # data_file = ".coverage" @@ -86,7 +86,7 @@ disallow_untyped_calls = true disallow_untyped_defs = true error_summary = true # site-packages is here to help vscode mypy integration getting confused -exclude = "(.cache|.config|.eggs|.tox|_readthedocs|build|dist|test/local-content|site|site-packages|~/.pyenv|examples|plugins/modules).*" +exclude = "(.cache|.config|.eggs|.tox|_readthedocs|build|dist|test/local-content|site|site-packages|~/.pyenv|examples|plugins/modules|test/fixtures/eco).*" # https://github.com/python/mypy/issues/12664 follow_untyped_imports = true incremental = false @@ -392,7 +392,7 @@ reportPrivateImportUsage = false [tool.pytest.ini_options] # do not add options here as this will likely break either console runs or IDE # integration like vscode or pycharm -addopts = "-p no:pytest_cov --durations=10 --failed-first" +addopts = "-p no:pytest_cov --durations=10 --failed-first -m 'not eco'" doctest_optionflags = ["ALLOW_UNICODE", "ELLIPSIS"] filterwarnings = [ "error", @@ -409,6 +409,9 @@ filterwarnings = [ "ignore:Attribute s is deprecated and will be removed in Python 3.14; use value instead:DeprecationWarning" ] junit_family = "legacy" +markers = [ + "eco: test impact on ecosystem repositories (slow)" +] minversion = "4.6.6" # https://code.visualstudio.com/docs/python/testing # coverage is re-enabled in `tox.ini`. That approach is safer than @@ -435,6 +438,7 @@ norecursedirs = [ "plugins", "site", "src/ansible_lint.egg-info", + "test/fixtures/eco", "test/schemas" ] python_files = [ @@ -574,6 +578,7 @@ exclude = [ "collections", "examples", "plugins", + "test/fixtures/eco", "test/local-content", "venv", "src/ansiblelint/_version.py" diff --git a/test/fixtures/eco/ansible-docker-rootless b/test/fixtures/eco/ansible-docker-rootless new file mode 160000 index 0000000000..a8b4650b9a --- /dev/null +++ b/test/fixtures/eco/ansible-docker-rootless @@ -0,0 +1 @@ +Subproject commit a8b4650b9a0033771171a1f0f5df0dade774c27b diff --git a/test/fixtures/eco/ansible-docker-rootless.json b/test/fixtures/eco/ansible-docker-rootless.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/eco/ansible-role-hardening b/test/fixtures/eco/ansible-role-hardening new file mode 160000 index 0000000000..8316d2a619 --- /dev/null +++ b/test/fixtures/eco/ansible-role-hardening @@ -0,0 +1 @@ +Subproject commit 8316d2a619bcca57de950e9800e3772d20de8e9f diff --git a/test/fixtures/eco/ansible-role-hardening.ignore.txt b/test/fixtures/eco/ansible-role-hardening.ignore.txt new file mode 100644 index 0000000000..20956b12a8 --- /dev/null +++ b/test/fixtures/eco/ansible-role-hardening.ignore.txt @@ -0,0 +1,2 @@ +# This file contains ignores rule violations for ansible-lint +molecule/default/verify.yml name[unique] diff --git a/test/fixtures/eco/ansible-role-hardening.json b/test/fixtures/eco/ansible-role-hardening.json new file mode 100644 index 0000000000..078ac03575 --- /dev/null +++ b/test/fixtures/eco/ansible-role-hardening.json @@ -0,0 +1,3 @@ +name[unique]: Task name 'Get PAM version' is not unique. It was first used on line 622. +molecule/default/verify.yml:1124 + diff --git a/test/fixtures/eco/ansible-role-mysql b/test/fixtures/eco/ansible-role-mysql new file mode 160000 index 0000000000..d1e9210935 --- /dev/null +++ b/test/fixtures/eco/ansible-role-mysql @@ -0,0 +1 @@ +Subproject commit d1e9210935dd0ad405020ec46808387cc5e7f1a5 diff --git a/test/fixtures/eco/ansible-role-mysql.ignore.txt b/test/fixtures/eco/ansible-role-mysql.ignore.txt new file mode 100644 index 0000000000..06184236e9 --- /dev/null +++ b/test/fixtures/eco/ansible-role-mysql.ignore.txt @@ -0,0 +1,12 @@ +# This file contains ignores rule violations for ansible-lint +handlers/main.yml name[casing] +meta/main.yml schema[meta] +tasks/databases.yml fqcn[action] +tasks/main.yml name[missing] +tasks/replication.yml fqcn[action] +tasks/replication.yml ignore-errors +tasks/secure-installation.yml fqcn[action] +tasks/secure-installation.yml jinja[spacing] +tasks/secure-installation.yml no-changed-when +tasks/setup-RedHat.yml fqcn[action-core] +tasks/users.yml fqcn[action] diff --git a/test/fixtures/eco/ansible-role-mysql.json b/test/fixtures/eco/ansible-role-mysql.json new file mode 100644 index 0000000000..2bfb80b516 --- /dev/null +++ b/test/fixtures/eco/ansible-role-mysql.json @@ -0,0 +1,100 @@ +name[casing]: All names should start with an uppercase letter. +handlers/main.yml:2:9 Task/Handler: restart mysql + +schema[meta]: $.galaxy_info.min_ansible_version 2.12 is not of type 'string'. See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#using-role-dependencies +meta/main.yml:1 Returned errors will not include exact line numbers, but they will mention +the schema name being used as a tag, like ``schema[playbook]``, +``schema[tasks]``. + +This rule is not skippable and stops further processing of the file. + +If incorrect schema was picked, you might want to either: + +* move the file to standard location, so its file is detected correctly. +* use ``kinds:`` option in linter config to help it pick correct file type. +[/] + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_db`. +tasks/databases.yml:3:3 Action `mysql_db` is not FQCN. + +name[missing]: All tasks should be named. +tasks/main.yml:3 Task/Handler: include_tasks variables.yml + +name[missing]: All tasks should be named. +tasks/main.yml:6 Task/Handler: include_tasks setup-RedHat.yml + +name[missing]: All tasks should be named. +tasks/main.yml:9 Task/Handler: include_tasks setup-Debian.yml + +name[missing]: All tasks should be named. +tasks/main.yml:12 Task/Handler: include_tasks setup-Archlinux.yml + +name[missing]: All tasks should be named. +tasks/main.yml:22 Task/Handler: include_tasks configure.yml + +name[missing]: All tasks should be named. +tasks/main.yml:23 Task/Handler: include_tasks secure-installation.yml + +name[missing]: All tasks should be named. +tasks/main.yml:24 Task/Handler: include_tasks databases.yml + +name[missing]: All tasks should be named. +tasks/main.yml:25 Task/Handler: include_tasks users.yml + +name[missing]: All tasks should be named. +tasks/main.yml:26 Task/Handler: include_tasks replication.yml + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_user`. +tasks/replication.yml:3:3 Action `mysql_user` is not FQCN. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_replication`. +tasks/replication.yml:18:3 Action `mysql_replication` is not FQCN. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_replication`. +tasks/replication.yml:32:3 Action `mysql_replication` is not FQCN. + +ignore-errors: Use failed_when and specify error conditions instead of using ignore_errors. +tasks/replication.yml:45 Task/Handler: Configure replication on the slave. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_replication`. +tasks/replication.yml:46:3 Action `mysql_replication` is not FQCN. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_replication`. +tasks/replication.yml:65:3 Action `mysql_replication` is not FQCN. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_user`. +tasks/secure-installation.yml:3:3 Action `mysql_user` is not FQCN. + +jinja[spacing]: Jinja2 spacing could be improved: {{ mysql_root_hosts.stdout_lines|default([]) }} -> {{ mysql_root_hosts.stdout_lines | default([]) }} (warning) +tasks/secure-installation.yml:45 Jinja2 template rewrite recommendation: `{{ mysql_root_hosts.stdout_lines | default([]) }}`. + +no-changed-when: Commands should not change things if nothing needs doing. +tasks/secure-installation.yml:45 Task/Handler: Update MySQL root authentication via socket for localhost (Linux, MySQL ≥ 8.4) + +jinja[spacing]: Jinja2 spacing could be improved: {{ mysql_root_hosts.stdout_lines|default([]) }} -> {{ mysql_root_hosts.stdout_lines | default([]) }} (warning) +tasks/secure-installation.yml:61 Jinja2 template rewrite recommendation: `{{ mysql_root_hosts.stdout_lines | default([]) }}`. + +no-changed-when: Commands should not change things if nothing needs doing. +tasks/secure-installation.yml:61 Task/Handler: Update MySQL root password for localhost root account (5.7.x ≤ MySQL < 8.4) + +jinja[spacing]: Jinja2 spacing could be improved: {{ mysql_root_hosts.stdout_lines|default([]) }} -> {{ mysql_root_hosts.stdout_lines | default([]) }} (warning) +tasks/secure-installation.yml:80 Jinja2 template rewrite recommendation: `{{ mysql_root_hosts.stdout_lines | default([]) }}`. + +no-changed-when: Commands should not change things if nothing needs doing. +tasks/secure-installation.yml:80 Task/Handler: Update MySQL root password for localhost root account (< 5.7.x). + +jinja[spacing]: Jinja2 spacing could be improved: {{ mysql_anonymous_hosts.stdout_lines|default([]) }} -> {{ mysql_anonymous_hosts.stdout_lines | default([]) }} (warning) +tasks/secure-installation.yml:110 Jinja2 template rewrite recommendation: `{{ mysql_anonymous_hosts.stdout_lines | default([]) }}`. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_user`. +tasks/secure-installation.yml:111:3 Action `mysql_user` is not FQCN. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_db`. +tasks/secure-installation.yml:118:3 Action `mysql_db` is not FQCN. + +fqcn[action-core]: Use FQCN for builtin module actions (ansible.builtin.yum). +tasks/setup-RedHat.yml:3:3 Use `ansible.builtin.dnf` or `ansible.legacy.dnf` instead. + +fqcn[action]: Use FQCN for module actions, such `community.mysql.mysql_user`. +tasks/users.yml:3:3 Action `mysql_user` is not FQCN. + diff --git a/test/fixtures/eco/ansible_collection_system b/test/fixtures/eco/ansible_collection_system new file mode 160000 index 0000000000..bc8bd65826 --- /dev/null +++ b/test/fixtures/eco/ansible_collection_system @@ -0,0 +1 @@ +Subproject commit bc8bd658268f5e7c1a6e0c1b3921683a993cb3e5 diff --git a/test/fixtures/eco/ansible_collection_system.ignore.txt b/test/fixtures/eco/ansible_collection_system.ignore.txt new file mode 100644 index 0000000000..8aa85caa03 --- /dev/null +++ b/test/fixtures/eco/ansible_collection_system.ignore.txt @@ -0,0 +1,81 @@ +# This file contains ignores rule violations for ansible-lint +.ansible/collections/ansible_collections/devroles/system/roles/authorized_key/defaults/main.yml var-naming[no-role-prefix] +.ansible/collections/ansible_collections/devroles/system/roles/dotfiles/tasks/03_vim.yml yaml[octal-values] +.ansible/collections/ansible_collections/devroles/system/roles/firewalld/defaults/main.yml yaml[comments] +.ansible/collections/ansible_collections/devroles/system/roles/mariadb/tasks/configure_access.yml yaml[octal-values] +.ansible/collections/ansible_collections/devroles/system/roles/mounts/defaults/main.yml var-naming[no-role-prefix] +.ansible/collections/ansible_collections/devroles/system/roles/mythtv/handlers/main.yml no-changed-when +.ansible/collections/ansible_collections/devroles/system/roles/mythtv/tasks/main.yml yaml[octal-values] +.ansible/collections/ansible_collections/devroles/system/roles/sudoers/defaults/main.yml var-naming[no-role-prefix] +.ansible/collections/ansible_collections/devroles/system/roles/sudoers/tasks/main.yml yaml[octal-values] +.ansible/collections/ansible_collections/devroles/system/roles/update_ca_trust/handlers/main.yml no-changed-when +.ansible/collections/ansible_collections/devroles/system/roles/update_ca_trust/tasks/main.yml yaml[octal-values] +.ansible/collections/ansible_collections/devroles/system/roles/webserver/defaults/main.yml var-naming[no-role-prefix] +.ansible/collections/ansible_collections/devroles/system/roles/webserver/tasks/letsencrypt.yml args[module] +galaxy.yml galaxy[no-changelog] +galaxy.yml galaxy[tags] +meta/runtime.yml meta-runtime[unsupported-version] +playbooks/molecule/dotfiles/prepare.yml fqcn[action-core] +playbooks/molecule/dotfiles/prepare.yml name[play] +playbooks/molecule/sudo/molecule.yml yaml[line-length] +roles/authorized_key/defaults/main.yml var-naming[no-role-prefix] +roles/authorized_key/molecule/shared/playbook.yml name[casing] +roles/authorized_key/molecule/shared/playbook.yml var-naming[no-role-prefix] +roles/common/molecule/shared/playbook.yml name[casing] +roles/container/molecule/shared/playbook.yml name[casing] +roles/copy_or_link/molecule/default/playbook.yml name[casing] +roles/copy_or_link/molecule/default/prepare.yml fqcn[action-core] +roles/copy_or_link/molecule/default/prepare.yml name[casing] +roles/copy_or_link/molecule/default/prepare.yml name[play] +roles/copy_or_link/molecule/default/prepare.yml yaml[octal-values] +roles/copy_or_link/molecule/local/playbook.yml fqcn[action-core] +roles/copy_or_link/molecule/local/playbook.yml name[casing] +roles/copy_or_link/molecule/local/prepare.yml fqcn[action-core] +roles/copy_or_link/molecule/local/prepare.yml fqcn[action] +roles/copy_or_link/molecule/local/prepare.yml name[casing] +roles/copy_or_link/molecule/local/prepare.yml name[play] +roles/copy_or_link/molecule/local/prepare.yml yaml[octal-values] +roles/copy_or_link/molecule/local/remote_playbook.yml name[play] +roles/dev/molecule/shared/playbook.yml name[casing] +roles/dev/molecule/shared/prepare.yml name[casing] +roles/dotfiles/molecule/shared/playbook.yml fqcn[action-core] +roles/dotfiles/molecule/shared/playbook.yml name[casing] +roles/dotfiles/tasks/03_vim.yml yaml[octal-values] +roles/epel/molecule/shared/playbook.yml name[casing] +roles/firewalld/defaults/main.yml yaml[comments] +roles/firewalld/molecule/shared/playbook.yml name[casing] +roles/flatpak/molecule/shared/playbook.yml fqcn[action-core] +roles/mariadb/molecule/shared/playbook.yml fqcn[action-core] +roles/mariadb/molecule/shared/playbook.yml name[casing] +roles/mariadb/tasks/configure_access.yml yaml[octal-values] +roles/mirror/molecule/shared/playbook.yml fqcn[action-core] +roles/mirror/molecule/shared/playbook.yml name[casing] +roles/mirror/molecule/shared/playbook.yml name[play] +roles/mounts/defaults/main.yml var-naming[no-role-prefix] +roles/mta/tasks/main.yml syntax-check[specific] +roles/mythtv/handlers/main.yml no-changed-when +roles/mythtv/tasks/main.yml yaml[octal-values] +roles/packages_server/molecule/shared/playbook.yml name[casing] +roles/packages_workstation/tasks/Linux/03_libvirt.yml yaml[octal-values] +roles/packages_workstation/tasks/Linux/05_kerberos.yml yaml[octal-values] +roles/packages_workstation/tasks/Linux/06_blu_ray.yml yaml[octal-values] +roles/packages_workstation/vars/MacOSX.yml var-naming[no-role-prefix] +roles/python_prep/molecule/shared/playbook.yml fqcn[action-core] +roles/python_prep/molecule/shared/playbook.yml name[casing] +roles/sudoers/defaults/main.yml var-naming[no-role-prefix] +roles/sudoers/molecule/shared/playbook.yml name[casing] +roles/sudoers/molecule/shared/prepare.yml fqcn[action-core] +roles/sudoers/molecule/shared/prepare.yml name[casing] +roles/sudoers/tasks/main.yml yaml[octal-values] +roles/system_repositories/molecule/container/playbook.yml fqcn[action-core] +roles/system_repositories/molecule/container/playbook.yml name[casing] +roles/system_repositories/molecule/container_fedora/playbook.yml fqcn[action-core] +roles/system_repositories/molecule/container_fedora/playbook.yml name[casing] +roles/update_ca_trust/handlers/main.yml no-changed-when +roles/update_ca_trust/molecule/shared/playbook.yml name[casing] +roles/update_ca_trust/molecule/shared/prepare.yml fqcn[action-core] +roles/update_ca_trust/molecule/shared/prepare.yml name[casing] +roles/update_ca_trust/molecule/shared/prepare.yml yaml[octal-values] +roles/update_ca_trust/tasks/main.yml yaml[octal-values] +roles/webserver/defaults/main.yml var-naming[no-role-prefix] +roles/webserver/tasks/letsencrypt.yml args[module] diff --git a/test/fixtures/eco/ansible_collection_system.json b/test/fixtures/eco/ansible_collection_system.json new file mode 100644 index 0000000000..98b7e812a9 --- /dev/null +++ b/test/fixtures/eco/ansible_collection_system.json @@ -0,0 +1,393 @@ +var-naming[no-role-prefix]: Variables names from within roles should use authorized_key_ as a prefix. (vars: authorized_key) +.ansible/collections/ansible_collections/devroles/system/roles/authorized_key/defaults/main.yml:1:1 + +yaml[octal-values]: Forbidden implicit octal value "0644" +.ansible/collections/ansible_collections/devroles/system/roles/dotfiles/tasks/03_vim.yml:31 + +yaml[comments]: Missing starting space in comment +.ansible/collections/ansible_collections/devroles/system/roles/firewalld/defaults/main.yml:11 + +yaml[comments]: Missing starting space in comment +.ansible/collections/ansible_collections/devroles/system/roles/firewalld/defaults/main.yml:28 + +yaml[octal-values]: Forbidden implicit octal value "0600" +.ansible/collections/ansible_collections/devroles/system/roles/mariadb/tasks/configure_access.yml:25 + +var-naming[no-role-prefix]: Variables names from within roles should use mounts_ as a prefix. (vars: mounts) +.ansible/collections/ansible_collections/devroles/system/roles/mounts/defaults/main.yml:11:1 + +no-changed-when: Commands should not change things if nothing needs doing. +.ansible/collections/ansible_collections/devroles/system/roles/mythtv/handlers/main.yml:27 Task/Handler: Move firmware + +yaml[octal-values]: Forbidden implicit octal value "0644" +.ansible/collections/ansible_collections/devroles/system/roles/mythtv/tasks/main.yml:16 + +var-naming[no-role-prefix]: Variables names from within roles should use sudoers_ as a prefix. (vars: sudoers) +.ansible/collections/ansible_collections/devroles/system/roles/sudoers/defaults/main.yml:3:1 + +yaml[octal-values]: Forbidden implicit octal value "0750" +.ansible/collections/ansible_collections/devroles/system/roles/sudoers/tasks/main.yml:49 + +yaml[octal-values]: Forbidden implicit octal value "0600" +.ansible/collections/ansible_collections/devroles/system/roles/sudoers/tasks/main.yml:57 + +no-changed-when: Commands should not change things if nothing needs doing. +.ansible/collections/ansible_collections/devroles/system/roles/update_ca_trust/handlers/main.yml:1 Task/Handler: update-ca-trust + +yaml[octal-values]: Forbidden implicit octal value "0644" +.ansible/collections/ansible_collections/devroles/system/roles/update_ca_trust/tasks/main.yml:23 + +yaml[octal-values]: Forbidden implicit octal value "0644" +.ansible/collections/ansible_collections/devroles/system/roles/update_ca_trust/tasks/main.yml:34 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_zone_cache_size) +.ansible/collections/ansible_collections/devroles/system/roles/webserver/defaults/main.yml:6:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_request_limit) +.ansible/collections/ansible_collections/devroles/system/roles/webserver/defaults/main.yml:8:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_max_connections_per_ip) +.ansible/collections/ansible_collections/devroles/system/roles/webserver/defaults/main.yml:10:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_bandwidth_limit_after_size) +.ansible/collections/ansible_collections/devroles/system/roles/webserver/defaults/main.yml:12:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_max_bandwidth_outbound) +.ansible/collections/ansible_collections/devroles/system/roles/webserver/defaults/main.yml:14:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_burst_queue) +.ansible/collections/ansible_collections/devroles/system/roles/webserver/defaults/main.yml:16:1 + +args[module]: missing required arguments: acme_version (warning) +.ansible/collections/ansible_collections/devroles/system/roles/webserver/tasks/letsencrypt.yml:57 Task/Handler: Retrieve letsencrypt certificate for {{ domain.tld }} + +galaxy[no-changelog]: No changelog found. Please add a changelog file. Refer to the galaxy.md file for more info. +galaxy.yml:1 + +galaxy[tags]: galaxy.yaml must have one of the required tags: ['application', 'cloud', 'database', 'eda', 'infrastructure', 'linux', 'monitoring', 'networking', 'security', 'storage', 'tools', 'windows'] +galaxy.yml:1 + +meta-runtime[unsupported-version]: 'requires_ansible' key must refer to a currently supported version such as: >=2.15.0, >=2.16.0, >=2.17.0, >=2.18.0 +meta/runtime.yml:1 + +name[play]: All plays should be named. +playbooks/molecule/dotfiles/prepare.yml:1 + +fqcn[action-core]: Use FQCN for builtin module actions (package). +playbooks/molecule/dotfiles/prepare.yml:5:7 Use `ansible.builtin.package` or `ansible.legacy.package` instead. + +yaml[line-length]: Line too long (576 > 160 characters) +playbooks/molecule/sudo/molecule.yml:17 + +var-naming[no-role-prefix]: Variables names from within roles should use authorized_key_ as a prefix. (vars: authorized_key) +roles/authorized_key/defaults/main.yml:1:1 + +name[casing]: All names should start with an uppercase letter. +roles/authorized_key/molecule/shared/playbook.yml:1:9 + +var-naming[no-role-prefix]: Variables names from within roles should use authorized_key_ as a prefix. (vars: authorized_key) +roles/authorized_key/molecule/shared/playbook.yml:7:7 + +name[casing]: All names should start with an uppercase letter. +roles/common/molecule/shared/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/container/molecule/shared/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/default/playbook.yml:1:9 + +name[play]: All plays should be named. +roles/copy_or_link/molecule/default/prepare.yml:1 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/default/prepare.yml:3:13 Task/Handler: touch file + +fqcn[action-core]: Use FQCN for builtin module actions (file). +roles/copy_or_link/molecule/default/prepare.yml:4:7 Use `ansible.builtin.file` or `ansible.legacy.file` instead. + +yaml[octal-values]: Forbidden implicit octal value "0600" +roles/copy_or_link/molecule/default/prepare.yml:7 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/playbook.yml:5:13 Task/Handler: run ansible over there + +fqcn[action-core]: Use FQCN for builtin module actions (command). +roles/copy_or_link/molecule/local/playbook.yml:6:7 Use `ansible.builtin.command` or `ansible.legacy.command` instead. + +name[play]: All plays should be named. +roles/copy_or_link/molecule/local/prepare.yml:1 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:5:13 Task/Handler: touch file + +fqcn[action-core]: Use FQCN for builtin module actions (file). +roles/copy_or_link/molecule/local/prepare.yml:6:7 Use `ansible.builtin.file` or `ansible.legacy.file` instead. + +yaml[octal-values]: Forbidden implicit octal value "0600" +roles/copy_or_link/molecule/local/prepare.yml:9 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:11:13 Task/Handler: install ansible + +fqcn[action-core]: Use FQCN for builtin module actions (package). +roles/copy_or_link/molecule/local/prepare.yml:12:7 Use `ansible.builtin.package` or `ansible.legacy.package` instead. + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:16:13 Task/Handler: create play structure + +fqcn[action-core]: Use FQCN for builtin module actions (file). +roles/copy_or_link/molecule/local/prepare.yml:17:7 Use `ansible.builtin.file` or `ansible.legacy.file` instead. + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/copy_or_link/molecule/local/prepare.yml:22 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:24:13 Task/Handler: create inventory file + +fqcn[action-core]: Use FQCN for builtin module actions (copy). +roles/copy_or_link/molecule/local/prepare.yml:25:7 Use `ansible.builtin.copy` or `ansible.legacy.copy` instead. + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/copy_or_link/molecule/local/prepare.yml:28 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:30:13 Task/Handler: create test files + +fqcn[action-core]: Use FQCN for builtin module actions (copy). +roles/copy_or_link/molecule/local/prepare.yml:31:7 Use `ansible.builtin.copy` or `ansible.legacy.copy` instead. + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/copy_or_link/molecule/local/prepare.yml:34 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:40:13 Task/Handler: create archive of collection + +fqcn[action]: Use FQCN for module actions, such `community.general.archive`. +roles/copy_or_link/molecule/local/prepare.yml:42:7 Action `archive` is not FQCN. + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:51:13 Task/Handler: create destination ansible_collections path + +fqcn[action-core]: Use FQCN for builtin module actions (file). +roles/copy_or_link/molecule/local/prepare.yml:52:7 Use `ansible.builtin.file` or `ansible.legacy.file` instead. + +yaml[octal-values]: Forbidden implicit octal value "0755" +roles/copy_or_link/molecule/local/prepare.yml:56 + +name[casing]: All names should start with an uppercase letter. +roles/copy_or_link/molecule/local/prepare.yml:58:13 Task/Handler: unarchive collection + +fqcn[action-core]: Use FQCN for builtin module actions (unarchive). +roles/copy_or_link/molecule/local/prepare.yml:59:7 Use `ansible.builtin.unarchive` or `ansible.legacy.unarchive` instead. + +name[play]: All plays should be named. +roles/copy_or_link/molecule/local/remote_playbook.yml:1 + +name[casing]: All names should start with an uppercase letter. +roles/dev/molecule/shared/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/dev/molecule/shared/prepare.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/dotfiles/molecule/shared/playbook.yml:1:9 + +fqcn[action-core]: Use FQCN for builtin module actions (package). +roles/dotfiles/molecule/shared/playbook.yml:6:7 Use `ansible.builtin.package` or `ansible.legacy.package` instead. + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/dotfiles/tasks/03_vim.yml:31 + +name[casing]: All names should start with an uppercase letter. +roles/epel/molecule/shared/playbook.yml:1:9 + +yaml[comments]: Missing starting space in comment +roles/firewalld/defaults/main.yml:11 + +yaml[comments]: Missing starting space in comment +roles/firewalld/defaults/main.yml:28 + +name[casing]: All names should start with an uppercase letter. +roles/firewalld/molecule/shared/playbook.yml:1:9 + +fqcn[action-core]: Use FQCN for builtin module actions (include_role). +roles/flatpak/molecule/shared/playbook.yml:5:7 Use `ansible.builtin.include_role` or `ansible.legacy.include_role` instead. + +name[casing]: All names should start with an uppercase letter. +roles/mariadb/molecule/shared/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/mariadb/molecule/shared/playbook.yml:14:13 Task/Handler: run test command + +fqcn[action-core]: Use FQCN for builtin module actions (command). +roles/mariadb/molecule/shared/playbook.yml:16:7 Use `ansible.builtin.command` or `ansible.legacy.command` instead. + +yaml[octal-values]: Forbidden implicit octal value "0600" +roles/mariadb/tasks/configure_access.yml:25 + +name[play]: All plays should be named. +roles/mirror/molecule/shared/playbook.yml:1 + +name[casing]: All names should start with an uppercase letter. +roles/mirror/molecule/shared/playbook.yml:27:13 Task/Handler: run doohickey + +fqcn[action-core]: Use FQCN for builtin module actions (command). +roles/mirror/molecule/shared/playbook.yml:28:7 Use `ansible.builtin.command` or `ansible.legacy.command` instead. + +name[casing]: All names should start with an uppercase letter. +roles/mirror/molecule/shared/playbook.yml:32:13 Task/Handler: print mirror output + +fqcn[action-core]: Use FQCN for builtin module actions (debug). +roles/mirror/molecule/shared/playbook.yml:33:7 Use `ansible.builtin.debug` or `ansible.legacy.debug` instead. + +var-naming[no-role-prefix]: Variables names from within roles should use mounts_ as a prefix. (vars: mounts) +roles/mounts/defaults/main.yml:11:1 + +syntax-check[specific]: You cannot use loops on 'import_role' statements. You should use 'include_role' instead. +roles/mta/tasks/main.yml:1:3 + +no-changed-when: Commands should not change things if nothing needs doing. +roles/mythtv/handlers/main.yml:27 Task/Handler: Move firmware + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/mythtv/tasks/main.yml:16 + +name[casing]: All names should start with an uppercase letter. +roles/packages_server/molecule/shared/playbook.yml:1:9 + +yaml[octal-values]: Forbidden implicit octal value "0711" +roles/packages_workstation/tasks/Linux/03_libvirt.yml:15 + +yaml[octal-values]: Forbidden implicit octal value "0755" +roles/packages_workstation/tasks/Linux/03_libvirt.yml:24 + +yaml[octal-values]: Forbidden implicit octal value "0755" +roles/packages_workstation/tasks/Linux/03_libvirt.yml:33 + +yaml[octal-values]: Forbidden implicit octal value "0755" +roles/packages_workstation/tasks/Linux/03_libvirt.yml:51 + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/packages_workstation/tasks/Linux/05_kerberos.yml:20 + +yaml[octal-values]: Forbidden implicit octal value "0755" +roles/packages_workstation/tasks/Linux/06_blu_ray.yml:5 + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/packages_workstation/tasks/Linux/06_blu_ray.yml:15 + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/packages_workstation/tasks/Linux/06_blu_ray.yml:33 + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/packages_workstation/tasks/Linux/06_blu_ray.yml:39 + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/packages_workstation/tasks/Linux/06_blu_ray.yml:45 + +var-naming[no-role-prefix]: Variables names from within roles should use packages_workstation_ as a prefix. (vars: packages_workstation) +roles/packages_workstation/vars/MacOSX.yml:1:1 + +name[casing]: All names should start with an uppercase letter. +roles/python_prep/molecule/shared/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/python_prep/molecule/shared/playbook.yml:6:13 Task/Handler: install a package + +fqcn[action-core]: Use FQCN for builtin module actions (package). +roles/python_prep/molecule/shared/playbook.yml:8:7 Use `ansible.builtin.package` or `ansible.legacy.package` instead. + +var-naming[no-role-prefix]: Variables names from within roles should use sudoers_ as a prefix. (vars: sudoers) +roles/sudoers/defaults/main.yml:3:1 + +name[casing]: All names should start with an uppercase letter. +roles/sudoers/molecule/shared/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/sudoers/molecule/shared/prepare.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/sudoers/molecule/shared/prepare.yml:4:13 Task/Handler: create groups + +fqcn[action-core]: Use FQCN for builtin module actions (group). +roles/sudoers/molecule/shared/prepare.yml:6:7 Use `ansible.builtin.group` or `ansible.legacy.group` instead. + +name[casing]: All names should start with an uppercase letter. +roles/sudoers/molecule/shared/prepare.yml:10:13 Task/Handler: create users in that group + +fqcn[action-core]: Use FQCN for builtin module actions (user). +roles/sudoers/molecule/shared/prepare.yml:12:7 Use `ansible.builtin.user` or `ansible.legacy.user` instead. + +yaml[octal-values]: Forbidden implicit octal value "0750" +roles/sudoers/tasks/main.yml:49 + +yaml[octal-values]: Forbidden implicit octal value "0600" +roles/sudoers/tasks/main.yml:57 + +name[casing]: All names should start with an uppercase letter. +roles/system_repositories/molecule/container/playbook.yml:6:13 Task/Handler: install sword + +fqcn[action-core]: Use FQCN for builtin module actions (package). +roles/system_repositories/molecule/container/playbook.yml:8:7 Use `ansible.builtin.package` or `ansible.legacy.package` instead. + +name[casing]: All names should start with an uppercase letter. +roles/system_repositories/molecule/container_fedora/playbook.yml:6:13 Task/Handler: install gcc-debuginfo + +fqcn[action-core]: Use FQCN for builtin module actions (package). +roles/system_repositories/molecule/container_fedora/playbook.yml:8:7 Use `ansible.builtin.package` or `ansible.legacy.package` instead. + +no-changed-when: Commands should not change things if nothing needs doing. +roles/update_ca_trust/handlers/main.yml:1 Task/Handler: update-ca-trust + +name[casing]: All names should start with an uppercase letter. +roles/update_ca_trust/molecule/shared/playbook.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/update_ca_trust/molecule/shared/prepare.yml:1:9 + +name[casing]: All names should start with an uppercase letter. +roles/update_ca_trust/molecule/shared/prepare.yml:4:13 Task/Handler: install openssl + +fqcn[action-core]: Use FQCN for builtin module actions (package). +roles/update_ca_trust/molecule/shared/prepare.yml:6:7 Use `ansible.builtin.package` or `ansible.legacy.package` instead. + +name[casing]: All names should start with an uppercase letter. +roles/update_ca_trust/molecule/shared/prepare.yml:10:13 Task/Handler: upload the source file + +fqcn[action-core]: Use FQCN for builtin module actions (copy). +roles/update_ca_trust/molecule/shared/prepare.yml:12:7 Use `ansible.builtin.copy` or `ansible.legacy.copy` instead. + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/update_ca_trust/molecule/shared/prepare.yml:17 + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/update_ca_trust/tasks/main.yml:23 + +yaml[octal-values]: Forbidden implicit octal value "0644" +roles/update_ca_trust/tasks/main.yml:34 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_zone_cache_size) +roles/webserver/defaults/main.yml:6:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_request_limit) +roles/webserver/defaults/main.yml:8:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_max_connections_per_ip) +roles/webserver/defaults/main.yml:10:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_bandwidth_limit_after_size) +roles/webserver/defaults/main.yml:12:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_max_bandwidth_outbound) +roles/webserver/defaults/main.yml:14:1 + +var-naming[no-role-prefix]: Variables names from within roles should use webserver_ as a prefix. (vars: nginx_burst_queue) +roles/webserver/defaults/main.yml:16:1 + +args[module]: missing required arguments: acme_version (warning) +roles/webserver/tasks/letsencrypt.yml:57 Task/Handler: Retrieve letsencrypt certificate for {{ domain.tld }} + diff --git a/test/fixtures/eco/bootstrap b/test/fixtures/eco/bootstrap new file mode 160000 index 0000000000..340f183922 --- /dev/null +++ b/test/fixtures/eco/bootstrap @@ -0,0 +1 @@ +Subproject commit 340f183922bc1fc526098168a3e444c384b54b50 diff --git a/test/fixtures/eco/bootstrap.ignore.txt b/test/fixtures/eco/bootstrap.ignore.txt new file mode 100644 index 0000000000..76ae68896a --- /dev/null +++ b/test/fixtures/eco/bootstrap.ignore.txt @@ -0,0 +1,7 @@ +# This file contains ignores rule violations for ansible-lint +bootstrap/defaults/main.yml yaml[truthy] +bootstrap/meta/argument_specs.yml yaml[truthy] +bootstrap/tasks/assert.yml yaml[truthy] +bootstrap/tasks/gather_facts.yml yaml[line-length] +bootstrap/tasks/gather_facts.yml yaml[truthy] +bootstrap/tasks/main.yml yaml[truthy] diff --git a/test/fixtures/eco/bootstrap.json b/test/fixtures/eco/bootstrap.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/eco/cisco.nxos b/test/fixtures/eco/cisco.nxos new file mode 160000 index 0000000000..82d79bdc15 --- /dev/null +++ b/test/fixtures/eco/cisco.nxos @@ -0,0 +1 @@ +Subproject commit 82d79bdc15d16190c515c1d5084903de4328b1cd diff --git a/test/fixtures/eco/cisco.nxos.ignore.txt b/test/fixtures/eco/cisco.nxos.ignore.txt new file mode 100644 index 0000000000..2b89bc8610 --- /dev/null +++ b/test/fixtures/eco/cisco.nxos.ignore.txt @@ -0,0 +1,6 @@ +# This file contains ignores rule violations for ansible-lint +tests/sanity/ignore-2.12.txt sanity[cannot-ignore] +tests/sanity/ignore-2.13.txt sanity[cannot-ignore] +tests/sanity/ignore-2.14.txt sanity[cannot-ignore] +tests/sanity/ignore-2.15.txt sanity[cannot-ignore] +tests/sanity/ignore-2.16.txt sanity[cannot-ignore] diff --git a/test/fixtures/eco/cisco.nxos.json b/test/fixtures/eco/cisco.nxos.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/eco/debops b/test/fixtures/eco/debops new file mode 160000 index 0000000000..f66d7db9ee --- /dev/null +++ b/test/fixtures/eco/debops @@ -0,0 +1 @@ +Subproject commit f66d7db9eea71ad5010010183ca0562ec14f00c4 diff --git a/test/fixtures/eco/debops.json b/test/fixtures/eco/debops.json new file mode 100644 index 0000000000..47497303bc --- /dev/null +++ b/test/fixtures/eco/debops.json @@ -0,0 +1,204 @@ +syntax-check[specific]: the role 'debops.debops.nixos' was not found in debops.debops:ansible.legacy:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/.ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/roles:/Users/ssbarnea/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks +ansible/playbooks/nixos.yml:29:15 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/apache/tasks/main.yml:44:3 + +syntax-check[specific]: the role 'debops.debops.global_handlers' was not found in debops.debops:ansible.legacy:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks/layer/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/.ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/roles:/Users/ssbarnea/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks/layer +ansible/roles/apt/tasks/main.yml:11:11 + +syntax-check[specific]: the role 'debops.debops.global_handlers' was not found in debops.debops:ansible.legacy:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/.ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/roles:/Users/ssbarnea/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks +ansible/roles/apt/tasks/main.yml:11:11 + +syntax-check[specific]: the role 'debops.debops.global_handlers' was not found in debops.debops:ansible.legacy:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks/service/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/.ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/roles:/Users/ssbarnea/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/ansible/playbooks/service +ansible/roles/apt/tasks/main.yml:11:11 + +syntax-check[specific]: the role 'debops.debops.global_handlers' was not found in debops.debops:ansible.legacy:/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/.ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/roles:/Users/ssbarnea/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T +ansible/roles/apt/tasks/main.yml:11:11 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/apt_cacher_ng/tasks/main.yml:23:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/apt_mirror/tasks/main.yml:52:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/avahi/tasks/main.yml:43:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/backup2l/tasks/main.yml:20:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/bind/tasks/main.yml:196:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.btrfs_subvolume'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/btrfs/tasks/main.yml:21:3 + +jinja[spacing]: Jinja2 spacing could be improved: {{ ((ansible_local.core.admin_users if (ansible_local.core.admin_users | d()) else []) + [(ansible_user if (ansible_user is defined and ansible_user not in (core__admin_blacklist_default_users + core__admin_blacklist_users)) else lookup("env", "USER"))]) | unique }} -> {{ ((ansible_local.core.admin_users if (ansible_local.core.admin_users | d()) else []) + [ansible_user if (ansible_user is defined and ansible_user not in (core__admin_blacklist_default_users + core__admin_blacklist_users)) else lookup("env", "USER")]) | unique }} (warning) +ansible/roles/core/defaults/main.yml:133:20 Jinja2 template rewrite recommendation: `{{ ((ansible_local.core.admin_users if (ansible_local.core.admin_users | d()) else []) + [ansible_user if (ansible_user is defined and ansible_user not in (core__admin_blacklist_default_users + core__admin_blacklist_users)) else lookup("env", "USER")]) | unique }}`. + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/cron/tasks/main.yml:42:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/debops_legacy/tasks/main.yml:10:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/dhcpd/tasks/main.yml:25:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/dhcrelay/tasks/main.yml:21:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/dnsmasq/tasks/main.yml:91:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/docker_registry/tasks/main.yml:26:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/dovecot/tasks/main.yml:70:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/elasticsearch/tasks/main.yml:76:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/etc_services/tasks/main.yml:34:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/etckeeper/tasks/main.yml:38:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/extrepo/tasks/main.yml:40:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/fail2ban/tasks/main.yml:24:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/ferm/tasks/main.yml:87:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/filebeat/tasks/main.yml:44:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/freeradius/tasks/main.yml:60:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/fuse/tasks/main.yml:17:3 + +jinja[spacing]: Jinja2 spacing could be improved: {{ ([(ansible_local.libvirtd.unix_sock_group if (ansible_local.libvirtd.unix_sock_group | d()) else "libvirt")] + (["kvm"] if (ansible_local | d() and ansible_local.libvirtd | d() and (ansible_local.libvirtd.hw_virt | d()) | bool) else [])) | join(",") }} -> {{ ([ansible_local.libvirtd.unix_sock_group if (ansible_local.libvirtd.unix_sock_group | d()) else "libvirt"] + (["kvm"] if (ansible_local | d() and ansible_local.libvirtd | d() and (ansible_local.libvirtd.hw_virt | d()) | bool) else [])) | join(",") }} (warning) +ansible/roles/gitlab_runner/tasks/main.yml:200 Jinja2 template rewrite recommendation: `{{ ([ansible_local.libvirtd.unix_sock_group if (ansible_local.libvirtd.unix_sock_group | d()) else "libvirt"] + (["kvm"] if (ansible_local | d() and ansible_local.libvirtd | d() and (ansible_local.libvirtd.hw_virt | d()) | bool) else [])) | join(",") }}`. + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/grub/tasks/main.yml:149:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/icinga/tasks/main.yml:63:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/icinga_db/tasks/main.yml:59:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/imapproxy/tasks/main.yml:40:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/influxdb_server/tasks/main.yml:73:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/java/tasks/main.yml:50:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/kibana/tasks/main.yml:74:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/ldap/tasks/main.yml:38:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/libuser/tasks/main.yml:24:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/libvirtd/tasks/main.yml:60:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/libvirtd_qemu/tasks/main.yml:46:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/lldpd/tasks/main.yml:42:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/logrotate/tasks/main.yml:24:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/lvm/tasks/main.yml:13:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/machine/tasks/main.yml:31:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/metricbeat/tasks/main.yml:44:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/minidlna/tasks/main.yml:25:3 + +fqcn[action-core]: Use FQCN for builtin module actions (shell). +ansible/roles/netbox/tasks/main.yml:228:3 Use `ansible.builtin.shell` or `ansible.legacy.shell` instead. + +fqcn[action-core]: Use FQCN for builtin module actions (file). +ansible/roles/netbox/tasks/main.yml:245:3 Use `ansible.builtin.file` or `ansible.legacy.file` instead. + +fqcn[action-core]: Use FQCN for builtin module actions (shell). +ansible/roles/netbox/tasks/main.yml:260:3 Use `ansible.builtin.shell` or `ansible.legacy.shell` instead. + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/nginx/tasks/main.yml:133:3 + +syntax-check[specific]: the role 'debops.debops.secret' was not found in debops.debops:ansible.legacy:/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/.ansible/roles:/Users/ssbarnea/code/a/ansible-lint/test/fixtures/eco/debops/roles:/Users/ssbarnea/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T +ansible/roles/nixos/tasks/main.yml:18:11 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/nscd/tasks/main.yml:21:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/opendkim/tasks/main.yml:27:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/pam_access/tasks/main.yml:14:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/pdns/tasks/main.yml:30:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/php/tasks/main.yml:122:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/resolvconf/tasks/main.yml:50:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/rsyslog/tasks/main.yml:104:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/slapd/tasks/main.yml:48:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/snapshot_snapper/tasks/main.yml:42:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/snmpd/tasks/main.yml:77:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/sshd/tasks/main.yml:229:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/sysctl/tasks/main.yml:46:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/tcpwrappers/tasks/main.yml:35:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/tinyproxy/tasks/main.yml:40:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/unattended_upgrades/tasks/main.yml:47:3 + +syntax-check[unknown-module]: couldn't resolve module/action 'debops.debops.dpkg_divert'. This often indicates a misspelling, missing collection, or incorrect module path. +ansible/roles/zabbix_agent/tasks/main.yml:40:3 + diff --git a/test/test_eco.py b/test/test_eco.py new file mode 100644 index 0000000000..9d58dbbaa8 --- /dev/null +++ b/test/test_eco.py @@ -0,0 +1,42 @@ +"""Slow ecosystem tests.""" + +import os +import pathlib +from subprocess import run + +import pytest + + +@pytest.mark.eco +@pytest.mark.parametrize( + "repo", + ( + "ansible-docker-rootless", + "ansible-role-hardening", + "ansible-role-mysql", + "ansible_collection_system", + "bootstrap", + "cisco.nxos", + "debops", + ), +) +def test_eco(repo: str) -> None: + """Test linter against a 3rd party repository.""" + proc = run( + ["ansible-lint", "-qq", "--generate-ignore", "--format=codeclimate"], + text=True, + capture_output=True, + check=False, + shell=True, + cwd=f"test/fixtures/eco/{repo}", + env={ + **os.environ, + "NO_COLOR": "1", + "ANSIBLE_LINT_IGNORE_FILE": f"test/fixtures/eco/{repo}.ignore.txt", + }, + ) + pathlib.Path(f"test/fixtures/eco/{repo}.json").write_text( + proc.stdout, encoding="utf-8" + ) + assert proc.returncode == 0 + run(["git", "diff", "--exit-code"], check=True) diff --git a/tools/test-eco.sh b/tools/test-eco.sh deleted file mode 100755 index 55792af8d9..0000000000 --- a/tools/test-eco.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -set -eu -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -if [[ -d "${SCRIPT_DIR}/../.cache/eco/.git" ]]; then - git -C "${SCRIPT_DIR}/../.cache/eco" pull -else - mkdir -p "${SCRIPT_DIR}/../.cache" - git clone --recursive https://github.com/ansible-community/ansible-lint-eco "${SCRIPT_DIR}/../.cache/eco" -fi -pushd "${SCRIPT_DIR}/../.cache/eco/projects" > /dev/null - - -for i in $(ls -d */); do - DIR=${i%%/} - RC=0 - pushd $DIR > /dev/null - # Calling ansible lint without any positional arguments inside repository root - SECONDS=0 - ANSIBLE_LINT_IGNORE_FILE=../$DIR.ignore.txt ansible-lint -qq --generate-ignore -f codeclimate | python3 -m json.tool > ../$DIR.json || - RC=$? - echo "Got $RC RC on $DIR in $SECONDS seconds" - popd > /dev/null -done -popd > /dev/null -# Fail if git reports dirty at the end -git diff --exit-code diff --git a/tox.ini b/tox.ini index 0b9b471b15..551d3f2314 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,6 @@ env_list = schemas lower pre - eco skip_missing_interpreters = true [testenv] @@ -62,6 +61,7 @@ set_env = lower: PIP_CONSTRAINT = {tox_root}/.github/lower-constraints.txt lower: UV_CONSTRAINT = {tox_root}/.github/lower-constraints.txt pre: PIP_PRE = 1 + py313: PYTEST_ADDOPTS = "-m=" commands_pre = sh -c "rm -f {env_dir}/.coverage.* 2>/dev/null || true" {env_python} -m pip check @@ -168,17 +168,6 @@ allowlist_externals = [testenv:lower] description = Install using lower-constraints.txt file for testing oldest versions. -[testenv:eco] -description = Perform ecosystem impact (downstream testing) https://github.com/ansible/ansible-lint/discussions/1403 -deps = - {[testenv]deps} -extras = - test -commands = - sh -c tools/test-eco.sh -allowlist_externals = - {[testenv]allowlist_externals} - [testenv:deps] description = Bump all test dependencies skip_install = true