diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..33ec2c2 --- /dev/null +++ b/.ansible-lint @@ -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 + diff --git a/ansible-requirements.txt b/ansible-requirements.txt index a1b6838..7507f3e 100644 --- a/ansible-requirements.txt +++ b/ansible-requirements.txt @@ -2,5 +2,5 @@ # 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 # be required for this repository. -ansible +ansible<2.10 ansible-lint diff --git a/ci-scripts/ansible-lint.sh b/ci-scripts/ansible-lint.sh deleted file mode 100755 index 69c9826..0000000 --- a/ci-scripts/ansible-lint.sh +++ /dev/null @@ -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 diff --git a/meta/main.yml b/meta/main.yml index 3a0638e..5d09ee6 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,8 +1,6 @@ galaxy_info: - author: - - Sam Doran - - David Critch - - Emilien Macchi + role_name: redhat-subscription + author: tripleo description: "Manage Red Hat subscription and repositories." company: license: Apache 2.0 @@ -13,6 +11,7 @@ galaxy_info: versions: - 6 - 7 + - 8 galaxy_tags: - system diff --git a/tasks/main.yml b/tasks/main.yml index d6a7459..23f16e7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -50,6 +50,7 @@ section: main option: proxy value: "{{ rhsm_rhsm_proxy_proto | default('http') }}://{{ rhsm_rhsm_proxy_hostname }}:{{ rhsm_rhsm_proxy_port }}" + mode: 0644 tags: - rhsm - rhsm_conf diff --git a/test-requirements.txt b/test-requirements.txt index 4626695..68c016a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 pyflakes>=2.2.0 diff --git a/tox.ini b/tox.ini index 73c23ed..d8e4f72 100644 --- a/tox.ini +++ b/tox.ini @@ -39,9 +39,8 @@ commands = | xargs flake8 --verbose" [testenv:ansible-lint] -basepython=python3 -commands = - bash ci-scripts/ansible-lint.sh +basepython = python3 +commands = ansible-lint [testenv:linters] basepython = python3