Skip to content

Commit

Permalink
Make ansible-lint version configuration (#47)
Browse files Browse the repository at this point in the history
* Make ansible-lint version configuration

* Fix ansible-lint install

* Fix if

* Fix else

* Fix ansible-lint command
  • Loading branch information
tersmitten authored Nov 3, 2020
1 parent 802b66c commit 327e0a3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
warn_list: # or 'skip_list' to silence them completely
- '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern
warn_list:
- '106'
18 changes: 14 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ env:

jobs:
include:
- python: "3.8" # as ansible-lint does not work on old python version
env: ANSIBLE_VERSION=latest ANSIBLE_LINT=yes
- python: "3.8"
env: ANSIBLE_VERSION=latest ANSIBLE_LINT_VERSION=latest
exclude:
- python: "2.7"
env: ANSIBLE_VERSION=latest
Expand All @@ -69,7 +69,14 @@ before_install:
install:
# Install Ansible.
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi
- if [ "$ANSIBLE_VERSION" = "latest" -a "$ANSIBLE_LINT" = "yes" ]; then pip install ansible-lint; fi
- >
if [ -n "$ANSIBLE_LINT_VERSION" ]; then
if [ "$ANSIBLE_LINT_VERSION" = "latest" ]; then
pip install ansible-lint;
else
pip install ansible-lint==$ANSIBLE_LINT_VERSION;
fi
fi
script:
# Check the role/playbook's syntax.
Expand All @@ -92,7 +99,10 @@ script:
&& (echo 'Availability test: pass' && exit 0)
|| (echo 'Availability test: fail' && exit 1)
- if [ "$ANSIBLE_VERSION" = "latest" -a "$ANSIBLE_LINT" = "yes" ]; then ansible-lint tests/test.yml; fi
- >
if [ -n "$ANSIBLE_LINT_VERSION" ]; then
ansible-lint tests/test.yml;
fi
notifications:
email: false
Expand Down

0 comments on commit 327e0a3

Please sign in to comment.