---
# .ansible-lint

profile: production # min, basic, moderate,safety, shared, production

# Allows dumping of results in SARIF format
# sarif_file: result.sarif

# exclude_paths included in this file are parsed relative to this file's location
# and not relative to the CWD of execution. CLI arguments passed to the --exclude
# option are parsed relative to the CWD of execution.
exclude_paths:
  - .github/
  - changelogs/
  - tests/templated_role_example
  - .ansible/

parseable: true
# quiet: true
# strict: true
# verbosity: 1

# Mock modules or roles in order to pass ansible-playbook --syntax-check
mock_modules:
  - ansible.controller.ad_hoc_command
  - ansible.controller.ad_hoc_command_cancel
  - ansible.controller.ad_hoc_command_wait
  - ansible.controller.application
  - ansible.controller.bulk_host_create
  - ansible.controller.bulk_host_delete
  - ansible.controller.bulk_job_launch
  - ansible.controller.controller_meta
  - ansible.controller.credential
  - ansible.controller.credential_input_source
  - ansible.controller.credential_type
  - ansible.controller.execution_environment
  - ansible.controller.export
  - ansible.controller.group
  - ansible.controller.host
  - ansible.controller.import
  - ansible.controller.instance
  - ansible.controller.instance_group
  - ansible.controller.inventory
  - ansible.controller.inventory_source
  - ansible.controller.inventory_source_update
  - ansible.controller.job_cancel
  - ansible.controller.job_launch
  - ansible.controller.job_list
  - ansible.controller.job_template
  - ansible.controller.job_wait
  - ansible.controller.label
  - ansible.controller.license
  - ansible.controller.notification_template
  - ansible.controller.organization
  - ansible.controller.project
  - ansible.controller.project_update
  - ansible.controller.role
  - ansible.controller.role_definition
  - ansible.controller.role_team_assignment
  - ansible.controller.role_user_assignment
  - ansible.controller.schedule
  - ansible.controller.settings
  - ansible.controller.subscriptions
  - ansible.controller.team
  - ansible.controller.token
  - ansible.controller.user
  - ansible.controller.workflow_approval
  - ansible.controller.workflow_job_template
  - ansible.controller.workflow_job_template_node
  - ansible.controller.workflow_launch
  - ansible.controller.workflow_node_wait.py
  - ansible.eda.controller_token
  - ansible.eda.credential
  - ansible.eda.credential_type
  - ansible.eda.decision_environment
  - ansible.eda.event_stream
  - ansible.eda.project
  - ansible.eda.rulebook_activation
  - ansible.eda.user
  - ansible.hub.ah_approval
  - ansible.hub.ah_build
  - ansible.hub.ah_collection
  - ansible.hub.ah_ee_image
  - ansible.hub.ah_ee_registry
  - ansible.hub.ah_ee_registry_index
  - ansible.hub.ah_ee_registry_sync
  - ansible.hub.ah_ee_repository
  - ansible.hub.ah_ee_repository_sync
  - ansible.hub.ah_group
  - ansible.hub.ah_namespace
  - ansible.hub.ah_role
  - ansible.hub.ah_token
  - ansible.hub.ah_user
  - ansible.hub.collection_remote
  - ansible.hub.collection_repository
  - ansible.hub.collection_repository_sync
  - ansible.hub.group_roles
  - ansible.platform.application
  - ansible.platform.authenticator
  - ansible.platform.authenticator_map
  - ansible.platform.http_port
  - ansible.platform.organization
  - ansible.platform.role_user_assignment
  - ansible.platform.route
  - ansible.platform.service
  - ansible.platform.service_cluster
  - ansible.platform.service_key
  - ansible.platform.service_node
  - ansible.platform.settings
  - ansible.platform.team
  - ansible.platform.user
  - job_wait

# mock_roles:
#   - mocked_role
#   - author.role_name # old standalone galaxy role
#   - fake_namespace.fake_collection.fake_role # role within a collection

# Enable checking of loop variable prefixes in roles
loop_var_prefix: ^(__|{role}_)

# Enforce variable names to follow pattern below, in addition to Ansible own
# requirements, like avoiding python identifiers. To disable add `var-naming`
# to skip_list.
var_naming_pattern: ^[a-z_][a-z0-9_]*$

use_default_rules: true
# Load custom rules from this specific folder
# rulesdir:
#   - ./rule/directory/

# Ansible-lint is able to recognize and load skip rules stored inside
# `.ansible-lint-ignore` (or `.config/ansible-lint-ignore.txt`) files.
# To skip a rule just enter filename and tag, like "playbook.yml package-latest"
# on a new line.
# Optionally you can add comments after the tag, prefixed by "#". We discourage
# the use of skip_list below because that will hide violations from the output.
# When putting ignores inside the ignore file, they are marked as ignored, but
# still visible, making it easier to address later.
skip_list:
  - fqcn[keyword]
  - jinja[spacing]
  - meta-runtime # This collection with the appropriate awx.awx or ansible.controller still works with older ansible.
  - role-name[path]
  - sanity[cannot-ignore] # We're only ignoring sanity rules when we have to
  - var-naming[no-role-prefix]

# Ansible-lint does not automatically load rules that have the 'opt-in' tag.
# You must enable opt-in rules by listing each rule 'id' below.
enable_list:
  - args
  - empty-string-compare # opt-in
  - no-log-password # opt-in
  - no-same-owner # opt-in
  - name[prefix] # opt-in
  - galaxy-version-incorrect # opt-in
  # add yaml here if you want to avoid ignoring yaml checks when yamllint
  # library is missing. Normally its absence just skips using that rule.
  - yaml
# Report only a subset of tags and fully ignore any others
# tags:
#   - jinja[spacing]

# Ansible-lint does not fail on warnings from the rules or tags listed below
warn_list:
  - experimental # experimental is included in the implicit list
  # - role-name
  # - yaml[document-start]  # you can also use sub-rule matches

# Some rules can transform files to fix (or make it easier to fix) identified
# errors. `ansible-lint --fix` will reformat YAML files and run these transforms.
# By default it will run all transforms (effectively `write_list: ["all"]`).
# You can disable running transforms by setting `write_list: ["none"]`.
# Or only enable a subset of rule transforms by listing rules/tags here.
# write_list:
#   - all

# Offline mode disables installation of requirements.yml and schema refreshing
offline: true

# Define required Ansible's variables to satisfy syntax check
# extra_vars:
#   foo: bar
#   multiline_string_variable: |
#     line1
#     line2
#   complex_variable: ":{;\t$()"

# Uncomment to enforce action validation with tasks, usually is not
# needed as Ansible syntax check also covers it.
# skip_action_validation: false

# List of additional kind:pattern to be added at the top of the default
# match list, first match determines the file kind.
# kinds:
# - playbook: "**/examples/*.{yml,yaml}"
# - galaxy: "**/folder/galaxy.yml"
# - tasks: "**/tasks/*.yml"
# - vars: "**/vars/*.yml"
# - meta: "**/meta/main.yml"
# - yaml: "**/*.yaml-too"

# List of additional collections to allow in only-builtins rule.
# only_builtins_allow_collections:
#   - example_ns.example_collection

# List of additions modules to allow in only-builtins rule.
# only_builtins_allow_modules:
#   - example_module

# Allow setting custom prefix for name[prefix] rule
task_name_prefix: "{stem} | "
# Complexity related settings

# Limit the depth of the nested blocks:
# max_block_depth: 20

# Also recognize these versions of Ansible as supported:
# supported_ansible_also:
#   - "2.14"
...
