From 9ffb6b8d7e65411444d72585cf4203bd44e266fc Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Thu, 4 Jul 2024 11:15:01 -0600 Subject: [PATCH 1/2] fix: add support for EL10 According to the Ansible team, support for listing platforms in role `meta/main.yml` files is being removed. Instead, they recommend using `galaxy_tags` https://github.com/ansible/ansible/blob/stable-2.17/changelogs/CHANGELOG-v2.17.rst "Remove the galaxy_info field platforms from the role templates" https://github.com/ansible/ansible/issues/82453 Many roles already have tags such as "rhel", "redhat", "centos", and "fedora". I propose that we ensure all of the system roles have these tags. Some of our roles support Suse, Debian, Ubuntu, and others. We should add tags for those e.g. the ssh role already has tags for "debian" and "ubuntu". In addition - for each version listed under `platforms.EL` - add a tag like `elN`. Q: Why not use a delimiter between the platform and the version e.g. `el-10`? This is not allowed by ansible-lint: ``` meta-no-tags: Tags must contain lowercase letters and digits only., invalid: 'el-10' meta/main.yml:1 ``` So we cannot use uppercase letters either. Q: Why not use our own meta/main.yml field? No other fields are allowed by ansible-lint: ``` syntax-check[specific]: 'myfield' is not a valid attribute for a RoleMetadata ``` Q: Why not use some other field? There are no other applicable or suitable fields. Q: What happens when we want to support versions like `N.M`? Use the word "dot" instead of "." e.g. `el10dot3`. Similarly - use "dash" instead of "-". We do not need tags such as `fedoraall`. The `fedora` tag implies that the role works on all supported versions of fedora. Otherwise, use tags such as `fedora40` if the role only supports specific versions. Signed-off-by: Rich Megginson --- roles/bpftrace/meta/main.yml | 4 ++++ roles/elasticsearch/meta/main.yml | 4 ++++ roles/grafana/meta/main.yml | 4 ++++ roles/mssql/meta/main.yml | 4 ++++ roles/pcp/meta/main.yml | 4 ++++ roles/postfix/meta/main.yml | 4 ++++ roles/redis/meta/main.yml | 4 ++++ roles/repository/meta/main.yml | 4 ++++ roles/spark/meta/main.yml | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/roles/bpftrace/meta/main.yml b/roles/bpftrace/meta/main.yml index af18247..993167b 100644 --- a/roles/bpftrace/meta/main.yml +++ b/roles/bpftrace/meta/main.yml @@ -33,3 +33,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu diff --git a/roles/elasticsearch/meta/main.yml b/roles/elasticsearch/meta/main.yml index 7da40de..b8658f2 100644 --- a/roles/elasticsearch/meta/main.yml +++ b/roles/elasticsearch/meta/main.yml @@ -33,3 +33,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu diff --git a/roles/grafana/meta/main.yml b/roles/grafana/meta/main.yml index 04c9cf0..7a184bf 100644 --- a/roles/grafana/meta/main.yml +++ b/roles/grafana/meta/main.yml @@ -33,3 +33,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu diff --git a/roles/mssql/meta/main.yml b/roles/mssql/meta/main.yml index 70fa871..87b654f 100644 --- a/roles/mssql/meta/main.yml +++ b/roles/mssql/meta/main.yml @@ -33,3 +33,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu diff --git a/roles/pcp/meta/main.yml b/roles/pcp/meta/main.yml index 8962326..b6fe017 100644 --- a/roles/pcp/meta/main.yml +++ b/roles/pcp/meta/main.yml @@ -32,3 +32,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu diff --git a/roles/postfix/meta/main.yml b/roles/postfix/meta/main.yml index 0cf25fe..27622d9 100644 --- a/roles/postfix/meta/main.yml +++ b/roles/postfix/meta/main.yml @@ -33,3 +33,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu diff --git a/roles/redis/meta/main.yml b/roles/redis/meta/main.yml index 0a8b5fb..0cd40dc 100644 --- a/roles/redis/meta/main.yml +++ b/roles/redis/meta/main.yml @@ -35,3 +35,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu diff --git a/roles/repository/meta/main.yml b/roles/repository/meta/main.yml index 91cee4f..2823151 100644 --- a/roles/repository/meta/main.yml +++ b/roles/repository/meta/main.yml @@ -28,3 +28,7 @@ galaxy_info: - packaging - monitoring - performance + - el + - fedora + - debian + - ubuntu diff --git a/roles/spark/meta/main.yml b/roles/spark/meta/main.yml index 6f3924b..949c978 100644 --- a/roles/spark/meta/main.yml +++ b/roles/spark/meta/main.yml @@ -32,3 +32,7 @@ galaxy_info: - lightweight - visualization - instrumentation + - el + - fedora + - debian + - ubuntu From 9dba88d0cc3f8b1335501958e9dbcc518854e2d3 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Thu, 4 Jul 2024 11:25:53 -0600 Subject: [PATCH 2/2] ansible-lint - repo is already in collection format - do not convert --- .github/workflows/ansible-lint.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 245af7d..2c88d26 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -11,10 +11,6 @@ on: # yamllint disable-line rule:truthy branches: - main workflow_dispatch: -env: - LSR_ROLE2COLL_NAMESPACE: performancecopilot - LSR_ROLE2COLL_NAME: metrics - TOX_WORK_DIR: .tox permissions: contents: read jobs: @@ -23,15 +19,5 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Convert role to collection format - run: | - set -euxo pipefail - coll_dir="$TOX_WORK_DIR/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}" - bash scripts/lsrcollection.sh - # ansible-lint action requires a .git directory??? - # https://github.com/ansible/ansible-lint/blob/main/action.yml#L45 - mkdir -p "$coll_dir/.git" - name: Run ansible-lint uses: ansible/ansible-lint@v24 - with: - working_directory: ${{ env.TOX_WORK_DIR }}/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}