Skip to content

Commit

Permalink
Update dependencies for ansible validated content
Browse files Browse the repository at this point in the history
Updated one of the project dependencies to use redhat.rhel_system_roles
instead of fedora system roles.

Moved the CODEOWNERS file to the root of the project instead of under
.github folder.
  • Loading branch information
r0x0d committed Apr 16, 2024
1 parent cf20f3c commit 64c4d90
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 55 deletions.
6 changes: 4 additions & 2 deletions .ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
# Ansible Linter rules
# mock_modules:
# - community.vmware.vmware_guest_snapshot
mock_modules:
- redhat.rhel_system_roles

profile: production

# Exclude paths from linter
exclude_paths:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Ansible Lint

on: [push, pull_request] # yamllint disable-line rule:truthy

env:
COLLECTION_NAMESPACE: infra
COLLECTION_NAME: convert2rhel

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install Ansible
run: pip install --upgrade ansible-core

- name: Configure Automation Hub
run: |
cat << EOF > ansible.cfg
[galaxy]
server_list = rh_automation_hub
[galaxy_server.rh_automation_hub]
url=https://console.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.CONSOLE_API_KEY }}
EOF
- name: Convert role to collection format
run: |
set -euxo pipefail
coll_dir="ansible_collections/${{ env.COLLECTION_NAMESPACE }}/${{ env.COLLECTION_NAME }}"
# 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: .

- name: Remove ansible.cfg
run: |
rm ansible.cfg
...
38 changes: 0 additions & 38 deletions .github/workflows/pre-commit.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
cat << EOF > ansible.cfg
[galaxy]
server_list = rh_automation_hub
[galaxy_server.rh_automation_hub]
url=https://cloud.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,6 @@ dmypy.json

install-deps
pre-commit

# Ignore ansible.cfg
ansible.cfg
13 changes: 0 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,4 @@ repos:
hooks:
- id: gitleaks
stages: [manual, push]
- repo: 'https://github.com/ansible-community/ansible-lint.git'
rev: v24.2.0
hooks:
- id: ansible-lint
pass_filenames: false
always_run: true
entry: "ansible-lint"
args:
- "--profile=production"
- "-c=.ansible-lint.yml"
additional_dependencies:
- "ansible-core>=2.14"
- "yamllint>=1.29,<2.0"
...
File renamed without changes.
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tags:
- conversions
- linux
repository: https://github.com/redhat-cop/infra.convert2rhel
# documentation: https://github.com/ansible-collection-migration/community.REPO_NAME/tree/main/docs
documentation: https://github.com/redhat-cop/infra.convert2rhel/tree/main/docs
homepage: https://github.com/redhat-cop/infra.convert2rhel
issues: https://github.com/redhat-cop/infra.convert2rhel/issues
build_ignore:
Expand All @@ -26,7 +26,7 @@ build_ignore:
- extensions
dependencies:
ansible.posix: ">=1.5.1"
fedora.linux_system_roles: ">=1.21.0"
redhat.rhel_system_roles: ">=1.21.0"
community.general: ">=6.6.0"
ansible.utils: ">=2.12.0"
...

0 comments on commit 64c4d90

Please sign in to comment.