User Tools

Site Tools


wiki:ansible

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:ansible [2024/08/25 21:32] – [Linting] adminwiki:ansible [2024/08/25 21:38] (current) – [Linting] admin
Line 11: Line 11:
   * https://jinjafx.io/   * https://jinjafx.io/
 ==== Linting ==== ==== Linting ====
 +
 Ansible provides a tool that checks your ansible files for best practices. Ansible provides a tool that checks your ansible files for best practices.
  
 To lint a specific file or automagically detect what to lint: To lint a specific file or automagically detect what to lint:
  
-ansible-lint <file> +ansible-lint ansible-lint
-ansible-lint+
  
 If using vim, the following snippet can be used to run ansible-lint inside the editor. By running :make, all the ansible-lint errors will be pulled into vim's quickfix list: If using vim, the following snippet can be used to run ansible-lint inside the editor. By running :make, all the ansible-lint errors will be pulled into vim's quickfix list:
Line 22: Line 22:
 autocmd BufRead,BufNewFile *.ymlyml autocmd BufRead,BufNewFile *.ymlyml
  
->\ set makeprg=ansible-lint\ -p errorformat=%f:%l:\ [E%n]\ %m,%f:%l:\ [EANSIBLE%n]\ %m,%f:%l:\ [ANSIBLE%n]\ %m,%f:%l:%c:\ %m,%f:%l:\ %m+\ set makeprg=ansible-lint\ -p errorformat=%f:%l:\ [E%n]\ %m,%f:%l:\ [EANSIBLE%n]\ %m,%f:%l:\ [ANSIBLE%n]\ %m,%f:%l:%c:\ %m,%f:%l:\ %m
  
 +//note: this changes makeprg & errorformat for all yml files which might not be what you want//
  
-note: this changes makeprg & errorformat for all yml files which might not be what you want 
  
wiki/ansible.1724621553.txt.gz · Last modified: 2024/08/25 21:32 by admin