CI: add ansible-lint to linters job
Adapted from kolla-ansible setup. Change-Id: I89fb9ccf03e445d1830dd5d525021cc5679d54a1
This commit is contained in:
parent
54d545a614
commit
5ac4536244
15
.ansible-lint
Normal file
15
.ansible-lint
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
use_default_rules: true
|
||||
skip_list:
|
||||
# [E503] Tasks that run when changed should likely be handlers
|
||||
# TODO(mnasiadka): Rework roles to do handlers instead of when: *.changed
|
||||
- no-handler
|
||||
# [E208] permissions not mentioned
|
||||
# FIXME(mnasiadka): Rework file/template to include permissions
|
||||
- risky-file-permissions
|
||||
# [unnamed-task] All tasks should be named
|
||||
# FIXME(mgoddard): Add names to all tasks
|
||||
- unnamed-task
|
||||
# [ignore-errors] Use failed_when and specify error conditions instead of using ignore_errors
|
||||
# FIXME(mgoddard): Use failed_when instead of ignore_errors
|
||||
- ignore-errors
|
@ -1,4 +1,5 @@
|
||||
# linting
|
||||
ansible-lint>=4.2.0,!=4.3.0 # MIT
|
||||
bandit>=1.1.0 # Apache-2.0
|
||||
bashate>=0.5.1 # Apache-2.0
|
||||
doc8>=0.6.0 # Apache-2.0
|
||||
|
6
tox.ini
6
tox.ini
@ -89,6 +89,7 @@ commands =
|
||||
{[testenv:bandit]commands}
|
||||
{[testenv:yamllint]commands}
|
||||
{[testenv:ansible-sanity]commands}
|
||||
{[testenv:ansible-lint]commands}
|
||||
|
||||
[testenv:pep8]
|
||||
deps = {[testenv:linters]deps}
|
||||
@ -123,3 +124,8 @@ commands = yamllint -s .
|
||||
[testenv:ansible-sanity]
|
||||
deps = {[testenv:linters]deps}
|
||||
commands = {toxinidir}/tools/run-ansible-sanity.sh {toxinidir}
|
||||
|
||||
[testenv:ansible-lint]
|
||||
deps = {[testenv:linters]deps}
|
||||
commands =
|
||||
ansible-lint -p
|
||||
|
Loading…
x
Reference in New Issue
Block a user