Fix CI
Cap ansible at <2.10 and fix hacking. Additionally convert ansible-lint to not use the old shell script and use .ansible-lint for skips Change-Id: I035ed9f3964ba904dc9ccfe048b69a68c6680253
This commit is contained in:
parent
ca1fcceeb3
commit
c6f9a7bdd7
|
@ -0,0 +1,8 @@
|
||||||
|
skip_list: # or 'skip_list' to silence them completely
|
||||||
|
- command-instead-of-shell # Use shell only when shell functionality is required
|
||||||
|
- experimental # all rules tagged as experimental
|
||||||
|
- no-changed-when # Commands should not change things if nothing needs doing
|
||||||
|
- no-handler # Tasks that run when changed should likely be handlers
|
||||||
|
- package-latest # Package installs should not use latest
|
||||||
|
- role-name # Role name {0} does not match ``^[a-z][a-z0-9_]+$`` pattern
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
# to licensing conflicts. But we sill need to be able to pull them in for
|
# to licensing conflicts. But we sill need to be able to pull them in for
|
||||||
# lint checks and want to document these as ansible specific things that may
|
# lint checks and want to document these as ansible specific things that may
|
||||||
# be required for this repository.
|
# be required for this repository.
|
||||||
ansible
|
ansible<2.10
|
||||||
ansible-lint
|
ansible-lint
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 303: Using command rather than module
|
|
||||||
# we have a few use cases where we need to use curl and rsync
|
|
||||||
# 503: Tasks that run when changed should likely be handlers
|
|
||||||
# this requires refactoring roles, skipping for now
|
|
||||||
# 301: Commands should not change things if nothing needs doing
|
|
||||||
# this requires refactoring roles, skipping for now
|
|
||||||
# 106: Role name {} does not match ^[a-z][a-z0-9_]+$ pattern
|
|
||||||
# this isn't in a collection and we'd need to maintain backwards compat
|
|
||||||
SKIPLIST="303,503,301,106"
|
|
||||||
|
|
||||||
# lint the playbooks separately to avoid linting the roles multiple times
|
|
||||||
for DIR in tasks playbooks; do
|
|
||||||
if [ -d "$DIR" ]; then
|
|
||||||
pushd $DIR
|
|
||||||
for playbook in `find . -type f -regex '.*\.y[a]?ml'`; do
|
|
||||||
ansible-lint -vvv -x $SKIPLIST $playbook || lint_error=1
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# lint all the possible roles
|
|
||||||
# Due to https://github.com/willthames/ansible-lint/issues/210, the roles
|
|
||||||
# directories need to contain a trailing slash at the end of the path.
|
|
||||||
if [ -d ./roles ]; then
|
|
||||||
for rolesdir in `find ./roles -maxdepth 1 -type d`; do
|
|
||||||
ansible-lint -vvv -x $SKIPLIST $rolesdir/ || lint_error=1
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# exit with 1 if we had a least an error or warning.
|
|
||||||
if [[ -n "$lint_error" ]]; then
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
|
@ -1,8 +1,6 @@
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author:
|
role_name: redhat-subscription
|
||||||
- Sam Doran
|
author: tripleo
|
||||||
- David Critch
|
|
||||||
- Emilien Macchi
|
|
||||||
description: "Manage Red Hat subscription and repositories."
|
description: "Manage Red Hat subscription and repositories."
|
||||||
company:
|
company:
|
||||||
license: Apache 2.0
|
license: Apache 2.0
|
||||||
|
@ -13,6 +11,7 @@ galaxy_info:
|
||||||
versions:
|
versions:
|
||||||
- 6
|
- 6
|
||||||
- 7
|
- 7
|
||||||
|
- 8
|
||||||
|
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- system
|
- system
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
section: main
|
section: main
|
||||||
option: proxy
|
option: proxy
|
||||||
value: "{{ rhsm_rhsm_proxy_proto | default('http') }}://{{ rhsm_rhsm_proxy_hostname }}:{{ rhsm_rhsm_proxy_port }}"
|
value: "{{ rhsm_rhsm_proxy_proto | default('http') }}://{{ rhsm_rhsm_proxy_hostname }}:{{ rhsm_rhsm_proxy_port }}"
|
||||||
|
mode: 0644
|
||||||
tags:
|
tags:
|
||||||
- rhsm
|
- rhsm
|
||||||
- rhsm_conf
|
- rhsm_conf
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
hacking>=4.0.0,<4.1.0 # Apache-2.0
|
||||||
bashate>=0.5.1 # Apache-2.0
|
bashate>=0.5.1 # Apache-2.0
|
||||||
pyflakes>=2.2.0
|
pyflakes>=2.2.0
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -39,9 +39,8 @@ commands =
|
||||||
| xargs flake8 --verbose"
|
| xargs flake8 --verbose"
|
||||||
|
|
||||||
[testenv:ansible-lint]
|
[testenv:ansible-lint]
|
||||||
basepython=python3
|
basepython = python3
|
||||||
commands =
|
commands = ansible-lint
|
||||||
bash ci-scripts/ansible-lint.sh
|
|
||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
|
|
Loading…
Reference in New Issue