|
| 1 | +--- |
| 2 | +# .ansible-lint |
| 3 | + |
| 4 | +profile: null # min, basic, moderate,safety, shared, production |
| 5 | + |
| 6 | +# Allows dumping of results in SARIF format |
| 7 | +# sarif_file: result.sarif |
| 8 | + |
| 9 | +# exclude_paths included in this file are parsed relative to this file's location |
| 10 | +# and not relative to the CWD of execution. CLI arguments passed to the --exclude |
| 11 | +# option are parsed relative to the CWD of execution. |
| 12 | +exclude_paths: |
| 13 | + - .cache/ # implicit unless exclude_paths is defined in config |
| 14 | + - test/fixtures/formatting-before/ |
| 15 | + - test/fixtures/formatting-prettier/ |
| 16 | +# parseable: true |
| 17 | +# quiet: true |
| 18 | +# strict: true |
| 19 | +# verbosity: 1 |
| 20 | + |
| 21 | +# Mock modules or roles in order to pass ansible-playbook --syntax-check |
| 22 | +mock_modules: |
| 23 | + - zuul_return |
| 24 | + # note the foo.bar is invalid as being neither a module or a collection |
| 25 | + - fake_namespace.fake_collection.fake_module |
| 26 | + - fake_namespace.fake_collection.fake_module.fake_submodule |
| 27 | +mock_roles: |
| 28 | + - mocked_role |
| 29 | + - author.role_name # old standalone galaxy role |
| 30 | + - fake_namespace.fake_collection.fake_role # role within a collection |
| 31 | + |
| 32 | +# Enable checking of loop variable prefixes in roles |
| 33 | +loop_var_prefix: "^(__|{role}_)" |
| 34 | + |
| 35 | +# Enforce variable names to follow pattern below, in addition to Ansible own |
| 36 | +# requirements, like avoiding python identifiers. To disable add `var-naming` |
| 37 | +# to skip_list. |
| 38 | +var_naming_pattern: "^[a-z_][a-z0-9_]*$" |
| 39 | + |
| 40 | +use_default_rules: true |
| 41 | +# Load custom rules from this specific folder |
| 42 | +# rulesdir: |
| 43 | +# - ./rule/directory/ |
| 44 | + |
| 45 | +# Ansible-lint is able to recognize and load skip rules stored inside |
| 46 | +# `.ansible-lint-ignore` (or `.config/ansible-lint-ignore.txt`) files. |
| 47 | +# To skip a rule just enter filename and tag, like "playbook.yml package-latest" |
| 48 | +# on a new line. |
| 49 | +# Optionally you can add comments after the tag, prefixed by "#". We discourage |
| 50 | +# the use of skip_list below because that will hide violations from the output. |
| 51 | +# When putting ignores inside the ignore file, they are marked as ignored, but |
| 52 | +# still visible, making it easier to address later. |
| 53 | +skip_list: |
| 54 | + - name[prefix] # Rule for checking task and subtask names (not the same) |
| 55 | + - name[play] # Rule for checking if all plays have names (not test.yml) |
| 56 | + - name[template] # Rule that only allows Jinja2 at the end of task names |
| 57 | + - yaml[line-length] # Rule for checking if the line is longer than 110 characters |
| 58 | + - key-order[task] # Rule for checking your Task order to: name, when, block |
| 59 | + - meta-incorrect # Rule for checking if meta config doesn't have default values |
| 60 | + - no-log-password # Rule for not logging outputs because of passwords |
| 61 | + |
| 62 | +# Ansible-lint does not automatically load rules that have the 'opt-in' tag. |
| 63 | +# You must enable opt-in rules by listing each rule 'id' below. |
| 64 | +enable_list: |
| 65 | + - args |
| 66 | + - empty-string-compare # opt-in |
| 67 | + - no-log-password # opt-in |
| 68 | + - no-same-owner # opt-in |
| 69 | + # add yaml here if you want to avoid ignoring yaml checks when yamllint |
| 70 | + # library is missing. Normally its absence just skips using that rule. |
| 71 | + - yaml |
| 72 | +# Report only a subset of tags and fully ignore any others |
| 73 | +# tags: |
| 74 | +# - jinja[spacing] |
| 75 | + |
| 76 | +# Ansible-lint does not fail on warnings from the rules or tags listed below |
| 77 | +warn_list: |
| 78 | + - skip_this_tag |
| 79 | + - experimental # experimental is included in the implicit list |
| 80 | + - role-name |
| 81 | + - yaml[document-start] # you can also use sub-rule matches |
| 82 | + |
| 83 | +# Some rules can transform files to fix (or make it easier to fix) identified |
| 84 | +# errors. `ansible-lint --fix` will reformat YAML files and run these transforms. |
| 85 | +# By default it will run all transforms (effectively `write_list: ["all"]`). |
| 86 | +# You can disable running transforms by setting `write_list: ["none"]`. |
| 87 | +# Or only enable a subset of rule transforms by listing rules/tags here. |
| 88 | +# write_list: |
| 89 | +# - all |
| 90 | + |
| 91 | +# Offline mode disables installation of requirements.yml and schema refreshing |
| 92 | +offline: true |
| 93 | + |
| 94 | +# Define required Ansible's variables to satisfy syntax check |
| 95 | +extra_vars: |
| 96 | + foo: bar |
| 97 | + multiline_string_variable: | |
| 98 | + line1 |
| 99 | + line2 |
| 100 | + complex_variable: ":{;\t$()" |
| 101 | + |
| 102 | +# Uncomment to enforce action validation with tasks, usually is not |
| 103 | +# needed as Ansible syntax check also covers it. |
| 104 | +# skip_action_validation: false |
| 105 | + |
| 106 | +# List of additional kind:pattern to be added at the top of the default |
| 107 | +# match list, first match determines the file kind. |
| 108 | +kinds: |
| 109 | + # - playbook: "**/examples/*.{yml,yaml}" |
| 110 | + # - galaxy: "**/folder/galaxy.yml" |
| 111 | + # - tasks: "**/tasks/*.yml" |
| 112 | + # - vars: "**/vars/*.yml" |
| 113 | + # - meta: "**/meta/main.yml" |
| 114 | + - yaml: "**/*.yaml-too" |
| 115 | + |
| 116 | +# List of additional collections to allow in only-builtins rule. |
| 117 | +# only_builtins_allow_collections: |
| 118 | +# - example_ns.example_collection |
| 119 | + |
| 120 | +# List of additions modules to allow in only-builtins rule. |
| 121 | +# only_builtins_allow_modules: |
| 122 | +# - example_module |
| 123 | + |
| 124 | +# Allow setting custom prefix for name[prefix] rule |
| 125 | +task_name_prefix: "{stem} | " |
| 126 | +# Complexity related settings |
| 127 | + |
| 128 | +# Limit the depth of the nested blocks: |
| 129 | +# max_block_depth: 20 |
0 commit comments