Skip to content
Snippets Groups Projects
Select Git revision
  • ead0f3b54f692bbb30d59a29840eab67cb40f71a
  • main default protected
  • Add_buttons_01
3 results

.ansible-lint

Blame
  • .ansible-lint 4.63 KiB
    ---
    # .ansible-lint
    
    profile: null # 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:
      - .cache/ # implicit unless exclude_paths is defined in config
      - test/fixtures/formatting-before/
      - test/fixtures/formatting-prettier/
    # parseable: true
    # quiet: true
    # strict: true
    # verbosity: 1
    
    # Mock modules or roles in order to pass ansible-playbook --syntax-check
    mock_modules:
      - zuul_return
      # note the foo.bar is invalid as being neither a module or a collection
      - fake_namespace.fake_collection.fake_module
      - fake_namespace.fake_collection.fake_module.fake_submodule
    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}_)"
    loop_var_prefix: "^[a-z_][a-z0-9_]*$"
    
    # 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:
      - skip_this_tag
      - var-naming[no-role-prefix]
      - loop-var-prefix[missing]
      ### Sometimes, it is need to run as command...
      - command-instead-of-module
      ### For not having the playbooks on the root path
      - role-name[path]
    
    # 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