Skip to content

Commit

Permalink
Update role (#7)
Browse files Browse the repository at this point in the history
- Update GitHub action workflows
- Update supported OS versions
- Switch from Docker to Podman for Molecule tests
- Update linting config
  • Loading branch information
ihmels authored Jun 8, 2023
1 parent eedcb08 commit b43e93b
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 87 deletions.
7 changes: 4 additions & 3 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_list:
- 'yaml'
- 'role-name'
---
exclude_paths:
- ./molecule/default/
- ./.github/
58 changes: 19 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,48 @@
---
name: CI

on:
pull_request:
push:
branches:
- main
pull_request:
schedule:
- cron: "30 6 * * 1"

defaults:
run:
working-directory: 'ihmels.rpmfusion_repo'
- cron: '0 5 * * 1'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
- name: Checkout
uses: actions/checkout@v3
with:
path: 'ihmels.rpmfusion_repo'

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install ansible ansible-lint[community,yamllint]
- name: Run ansible-lint
uses: ansible-community/ansible-lint-action@main

- name: Lint code.
run: |
yamllint .
ansible-lint .
molecule:
name: Molecule
test:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- 'docker.io/geerlingguy/docker-fedora37-ansible:latest'
- 'docker.io/geerlingguy/docker-fedora36-ansible:latest'
- 'docker.io/geerlingguy/docker-rockylinux9-ansible:latest'
- 'docker.io/geerlingguy/docker-rockylinux8-ansible:latest'
- 'docker.io/geerlingguy/docker-centos8-ansible:latest'
- 'docker.io/geerlingguy/docker-centos7-ansible:latest'
- docker.io/geerlingguy/docker-fedora38-ansible:latest
- docker.io/geerlingguy/docker-fedora37-ansible:latest
- docker.io/geerlingguy/docker-rockylinux9-ansible:latest
- docker.io/geerlingguy/docker-rockylinux8-ansible:latest
- docker.io/geerlingguy/docker-centos8-ansible:latest
- docker.io/geerlingguy/docker-centos7-ansible:latest
fail-fast: false

steps:
- name: Check out the codebase.
- name: Checkout
uses: actions/checkout@v3
with:
path: 'ihmels.rpmfusion_repo'

- name: Set up Python 3.
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install ansible molecule[docker] docker
- name: Install test dependencies
run: python -m pip install ansible-core molecule molecule-plugins[podman]

- name: Run Molecule tests.
- name: Run Molecule tests
run: molecule test
env:
MOLECULE_IMAGE: ${{ matrix.image }}
6 changes: 0 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ on:
tags:
- '*'

defaults:
run:
working-directory: 'ihmels.rpmfusion_repo'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
with:
path: 'ihmels.rpmfusion_repo'

- name: Set up Python 3.
uses: actions/setup-python@v4
Expand Down
28 changes: 0 additions & 28 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
---
# Based on ansible-lint config
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Ansible Role: RPM Fusion repositories
=====================================

Installs [RPM Fusion][1] free and nonfree repositories.
Installs and configures [RPM Fusion][1] free and nonfree repositories.

Requirements
------------
Expand All @@ -13,26 +13,26 @@ Role Variables

Available variables are listed below, along with default values (see `defaults/main.yml`).

The URLs from which the RPM Fusion free and nonfree repositories will be downloaded and installed:

rpmfusion_repo_free_repo_url: "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ rpmfusion_repo_distribution_major_version }}.noarch.rpm"
rpmfusion_repo_nonfree_repo_url: "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-{{ rpmfusion_repo_distribution_major_version }}.noarch.rpm"

The URLs from which the RPM Fusion free and nonfree repositories will be downloaded and installed.
GPG key location for RPM Fusion free and nonfree repositories:

rpmfusion_repo_free_gpg_url: "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-{{ rpmfusion_repo_distribution }}-{{ rpmfusion_repo_gpg_key_version }}"
rpmfusion_repo_nonfree_gpg_url: "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-nonfree-{{ rpmfusion_repo_distribution }}-{{ rpmfusion_repo_gpg_key_version }}"

GPG key location for RPM Fusion free and nonfree repositories.
GPG key fingerprints for corresponding keys:

rpmfusion_repo_free_fingerprint: "{{ rpmfusion_repo_fingerprints[rpmfusion_repo_distribution][rpmfusion_repo_gpg_key_version]['free'] }}"
rpmfusion_repo_nonfree_fingerprint: "{{ rpmfusion_repo_fingerprints[rpmfusion_repo_distribution][rpmfusion_repo_gpg_key_version]['nonfree'] }}"

GPG key fingerprints for corresponding keys.
Enable or disable repositories:

rpmfusion_repo_enable_free: true
rpmfusion_repo_enable_nonfree: true

Enable or disable repositories.

Dependencies
------------

Expand Down
8 changes: 5 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
galaxy_info:
role_name: rpmfusion_repo
namespace: ihmels
author: Yannick Ihmels <[email protected]>
description: Install RPM Fusion repositories
author: Yannick Ihmels
description: Install and configure RPM Fusion repositories
issue_tracker_url: https://github.com/ihmels/ansible-role-rpm-fusion/issues
license: MIT
min_ansible_version: '2.10'
platforms:
- name: Fedora
versions:
- '36'
- '37'
- '38'
- name: EL
versions:
- '7'
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
dependency:
name: galaxy
driver:
name: docker
name: podman
platforms:
- name: instance
image: "${MOLECULE_IMAGE:-docker.io/geerlingguy/docker-fedora37-ansible:latest}"
image: "${MOLECULE_IMAGE:-docker.io/geerlingguy/docker-fedora38-ansible:latest}"
pre_build_image: true
provisioner:
name: ansible
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible>=2.10
3 changes: 3 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
collections:
- name: community.general

0 comments on commit b43e93b

Please sign in to comment.