ANSIBLE-LINT(1)

πŸ“¦
version 26.1.1 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute

πŸŽ€ ansible-lint(1) πŸŽ€

User Commands section, and it is giving main character energy πŸ’…

✨ NAME ✨

ansible-lint is the lint tool for Ansible playbooks 🧚 It checks your playbooks for problems so you don't have to find them the hard way 😭

πŸ’– DESCRIPTION πŸ’–

Okay so here's the usage line, bestie 🫢

usage: ansible-lint [-h] [-P | -L | -T]

[-f {brief,full,md,json,codeclimate,quiet,pep8,sarif}]
      [--sarif-file SARIF_FILE] [-q] [--profile
      {min,basic,moderate,safety,shared,production}] [-p]
      [--project-dir PROJECT_DIR] [-r RULESDIR] [-R] [-s] [--write
      [WRITE_LIST]] [--show-relpath] [-t TAGS] [-v] [-x SKIP_LIST]
      [--generate-ignore] [-w WARN_LIST] [--enable-list ENABLE_LIST]
      [--nocolor] [--force-color] [--exclude EXCLUDE_PATHS
      [EXCLUDE_PATHS ...]]  [-c CONFIG_FILE] [-i IGNORE_FILE]
      [--offline] [--version] [lintables ...]

🌸 positional arguments 🌸

  • lintables β€” one or more files or paths πŸ“ If you leave it out, ansible-lint switches to auto-detection mode, so it does the looking for you ✨

πŸ’… options πŸ’…

  • -h, --help β€” shows this help message and exits πŸ™ˆ
  • -P, --list-profiles β€” lists all the profiles πŸ¦‹ There are no formatting options for this one.
  • -L, --list-rules β€” lists all the rules πŸ“‹ For this, the only -f formats that work are {brief, full, md}, and brief is the default.
  • -T, --list-tags β€” lists all the tags and which rules they cover 🏷️ Bump up the verbosity with -v if you want the opt-in tag and its rules to show up too πŸ‘€
  • -f {brief,full,md,json,codeclimate,quiet,pep8,sarif}, --format {brief,full,md,json,codeclimate,quiet,pep8,sarif} β€” picks the stdout formatting πŸ’… json is just an alias for codeclimate. (default: None)
  • --sarif-file SARIF_FILE β€” the SARIF output file πŸ“
  • -q β€” quieter, with less verbosity 🀫 You can use it twice if you really want it hushed 🫢
  • --profile {min,basic,moderate,safety,shared,production} β€” choose which rules profile you want to use πŸ‘‘
  • -p, --parseable β€” parseable output, same vibe as -f pep8 ✨
  • --project-dir PROJECT_DIR β€” where your project or repository lives 🌈 It gets autodetected based on where the configuration file is.
  • -r RULESDIR, --rules-dir RULESDIR β€” point it at custom rule directories πŸ”₯ Add -R if you want to keep using the embedded rules from /usr/lib/python3/dist-packages/ansiblelint/rules too.
  • -R β€” keeps the default rules when you're using -r πŸ’œ
  • -s, --strict β€” returns a non-zero exit code for warnings as well as errors πŸ₯Ί Strict and serious πŸ’€
  • --write [WRITE_LIST] β€” lets ansible-lint reformat YAML files and run rule transforms ✨ Reformatting standardizes spacing, quotes, and so on, and a rule transform can fix or simplify the issue that rule found 🧚 You can limit which transforms run (that's the write_list) by passing the keywords all or none, or a comma-separated list of rule ids or rule tags. YAML reformatting happens whenever --write or --write= is used πŸ’– --write and --write=all are the same thing, and they let every transform run πŸ™Œ The effective list comes from write_list in the config file first, then whatever --write args you pass on the commandline gets applied after πŸŽ€ --write=none resets the transform list so you get YAML reformatting without any transforms running. For example, --write=none,rule-id will ignore write_list in the config file and only run the rule-id transform πŸ’…
Heads up, bestie: the --write flag is what lets ansible-lint actually rewrite your files. Use it with care 😭
  • --show-relpath β€” displays paths relative to the current working directory πŸ¦‹
  • -t TAGS, --tags TAGS β€” only checks rules whose id or tags match these values 🎯
  • -v β€” ups the verbosity level, and -vv goes even higher πŸ“’
  • -x SKIP_LIST, --skip-list SKIP_LIST β€” only checks rules whose id or tags do not match these values πŸ™ˆ For example: --skip-list=name,run-once
  • --generate-ignore β€” generates a text file called .ansible-lint-ignore that ignores every violation it finds 🫠 Each line holds a filename and a rule id, separated by a space πŸ“
  • -w WARN_LIST, --warn-list WARN_LIST β€” only warns about these rules, unless the config file overrides it 🚨 The current default value is: experimental, jinja[spacing], fqcn[deep]
  • --enable-list ENABLE_LIST β€” turns on optional rules by their tag name ✨
  • --nocolor β€” turns off colored output, same as NO_COLOR=1 πŸ–€
  • --force-color β€” forces colored output, same as FORCE_COLOR=1 🌈
  • --exclude EXCLUDE_PATHS [EXCLUDE_PATHS ...] β€” paths to directories or files you want to skip 🚫 You can repeat this option as many times as you need 🫢
  • -c CONFIG_FILE, --config-file CONFIG_FILE β€” picks the configuration file to use πŸŽ€ By default it looks for .ansible-lint, .config/ansible-lint.yml, or .config/ansible-lint.yaml πŸ‘€
  • -i IGNORE_FILE, --ignore-file IGNORE_FILE β€” picks the ignore file to use 🧹 By default it looks for .ansible-lint-ignore or .config/ansible-lintignore.txt πŸ’œ
  • --offline β€” disables installing requirements.yml and refreshing the schema πŸ“΄
  • --version β€” the version flag πŸ”’ The page doesn't give any more detail than that, so that's the tea β˜•

Okay that's the whole manual, bestie πŸ’– Source: ansible-lint, dated June 2023 πŸ¦‹ Stay linted, stay iconic 🌸✨

πŸ“¦ where this page comes from