G5: role lint also resolves the role's bare name

Galaxy-skeleton tests/test.yml files name the role either by its repo
name (ansible-role-x) or its bare name (x). ansible-role-eom uses the
bare name, which made syntax-check fail, and syntax-check can't be
baselined. Link both aliases to the linted copy. Update the documented
baseline command and the test table.

Refs DevOps/software-infrastructure#53

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 09:16:36 -05:00
co-authored by Claude Opus 5.5
parent 482ad09d77
commit 69e12d205f
2 changed files with 9 additions and 2 deletions
@@ -58,9 +58,12 @@ jobs:
mkdir -p "$roles/$name" mkdir -p "$roles/$name"
cp -a . "$roles/$name/" cp -a . "$roles/$name/"
# The galaxy skeleton's tests/test.yml names the role by its repo # The galaxy skeleton's tests/test.yml names the role by its repo
# name, so make that resolve too (syntax-check can't be skipped). # name (ansible-role-x) or its bare name (x), so make both resolve
# too (syntax-check can't be skipped or baselined).
repo_name="${REPO##*/}" repo_name="${REPO##*/}"
if [ "$repo_name" != "$name" ]; then ln -sfn "$roles/$name" "$roles/$repo_name"; fi for alias in "$repo_name" "${repo_name#ansible-role-}"; do
if [ "$alias" != "$name" ]; then ln -sfn "$roles/$name" "$roles/$alias"; fi
done
export ANSIBLE_ROLES_PATH="$roles" export ANSIBLE_ROLES_PATH="$roles"
cd "$roles/$name" cd "$roles/$name"
echo "Linting role as ${name} with $(ansible-lint --version | head -1)" echo "Linting role as ${name} with $(ansible-lint --version | head -1)"
+4
View File
@@ -70,6 +70,7 @@ and fail only on new problems, commit a baseline:
docker run --rm -v "$PWD:/src" -w /tmp gitea.eom.dev/devops/ci-tools:1.0.0 bash -c ' docker run --rm -v "$PWD:/src" -w /tmp gitea.eom.dev/devops/ci-tools:1.0.0 bash -c '
mkdir -p /tmp/roles && cp -a /src /tmp/roles/ericomeehan.NAME && mkdir -p /tmp/roles && cp -a /src /tmp/roles/ericomeehan.NAME &&
ln -s /tmp/roles/ericomeehan.NAME /tmp/roles/ansible-role-NAME && ln -s /tmp/roles/ericomeehan.NAME /tmp/roles/ansible-role-NAME &&
ln -s /tmp/roles/ericomeehan.NAME /tmp/roles/NAME &&
cd /tmp/roles/ericomeehan.NAME && cd /tmp/roles/ericomeehan.NAME &&
ANSIBLE_ROLES_PATH=/tmp/roles ansible-lint --warn-list role-name --exclude .gitea --generate-ignore; ANSIBLE_ROLES_PATH=/tmp/roles ansible-lint --warn-list role-name --exclude .gitea --generate-ignore;
cp .ansible-lint-ignore /src/' cp .ansible-lint-ignore /src/'
@@ -166,6 +167,9 @@ a local build of the tools image (1.0.0), against:
| ansible-role-lint | DevOps/ansible-role-gitea as it is | fails, 48 findings | | ansible-role-lint | DevOps/ansible-role-gitea as it is | fails, 48 findings |
| | the same with a generated baseline | passes | | | the same with a generated baseline | passes |
| | baseline plus a new `shell:` task | fails on the new task only | | | baseline plus a new `shell:` task | fails on the new task only |
| role lint (2026-11-16, G5 batch 2) | eom, discourse, mcp-servers, listmonk, prometheus with generated baselines, and gitea, www, dex again | all pass |
| | listmonk plus a new `tasks/extra.yml` with an unnamed `shell:` | fails on the new file |
| | eom with the previous step (no bare-name link) | fails: `tests/test.yml` names the role `eom` |
| helm-lint | DevOps/helm-jamulus | passes | | helm-lint | DevOps/helm-jamulus | passes |
| | a template referencing a missing value | fails in `helm lint` | | | a template referencing a missing value | fails in `helm lint` |
| | a Service with a string port | fails in kubeconform | | | a Service with a string port | fails in kubeconform |