summaryrefslogtreecommitdiffstats
path: root/src/ansiblelint/constants.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ansiblelint/constants.py47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/ansiblelint/constants.py b/src/ansiblelint/constants.py
index 6b8bd12..56cf71b 100644
--- a/src/ansiblelint/constants.py
+++ b/src/ansiblelint/constants.py
@@ -1,11 +1,26 @@
"""Constants used by AnsibleLint."""
+
from enum import Enum
from pathlib import Path
from typing import Literal
DEFAULT_RULESDIR = Path(__file__).parent / "rules"
CUSTOM_RULESDIR_ENVVAR = "ANSIBLE_LINT_CUSTOM_RULESDIR"
-RULE_DOC_URL = "https://ansible-lint.readthedocs.io/rules/"
+RULE_DOC_URL = "https://ansible.readthedocs.io/projects/lint/rules/"
+SKIP_SCHEMA_UPDATE = "ANSIBLE_LINT_SKIP_SCHEMA_UPDATE"
+
+ENV_VARS_HELP = {
+ CUSTOM_RULESDIR_ENVVAR: "Used for adding another folder into the lookup path for new rules.",
+ "ANSIBLE_LINT_IGNORE_FILE": "Define it to override the name of the default ignore file `.ansible-lint-ignore`",
+ "ANSIBLE_LINT_WRITE_TMP": "Tells linter to dump fixes into different temp files instead of overriding original. Used internally for testing.",
+ SKIP_SCHEMA_UPDATE: "Tells ansible-lint to skip schema refresh.",
+ "ANSIBLE_LINT_NODEPS": "Avoids installing content dependencies and avoids performing checks that would fail when modules are not installed. Far less violations will be reported.",
+}
+
+EPILOG = (
+ "The following environment variables are also recognized but there is no guarantee that they will work in future versions:\n\n"
+ + "\n".join(f"{key}: {value}\n" for key, value in ENV_VARS_HELP.items())
+)
# Not using an IntEnum because only starting with py3.11 it will evaluate it
@@ -126,6 +141,36 @@ PLAYBOOK_TASK_KEYWORDS = [
"pre_tasks",
"post_tasks",
]
+PLAYBOOK_ROLE_KEYWORDS = [
+ "any_errors_fatal",
+ "become",
+ "become_exe",
+ "become_flags",
+ "become_method",
+ "become_user",
+ "check_mode",
+ "collections",
+ "connection",
+ "debugger",
+ "delegate_facts",
+ "delegate_to",
+ "diff",
+ "environment",
+ "ignore_errors",
+ "ignore_unreachable",
+ "module_defaults",
+ "name",
+ "role",
+ "no_log",
+ "port",
+ "remote_user",
+ "run_once",
+ "tags",
+ "throttle",
+ "timeout",
+ "vars",
+ "when",
+]
NESTED_TASK_KEYS = [
"block",
"always",