1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_amdgpu_firmware.git synced 2024-08-16 14:59:49 +02:00

cleanup, linting and update

This commit is contained in:
L3D 2023-10-29 01:14:14 +02:00
parent 311e600f07
commit 76cb46170a
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
21 changed files with 136 additions and 237 deletions

9
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,9 @@
---
# See https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:bullseye
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with debian:bullseye
uses: roles-ansible/check-ansible-debian-bullseye-action@main
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:buster
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with debian:buster
uses: roles-ansible/check-ansible-debian-buster-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with debian:latest
uses: roles-ansible/check-ansible-debian-latest-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:sid
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with debian:sid
uses: roles-ansible/check-ansible-debian-sid-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:stable
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with debian:stable
uses: roles-ansible/check-ansible-debian-stable-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:stretch
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with debian:stretch
uses: roles-ansible/check-ansible-debian-stretch-action@master
with:
targets: "./"

View file

@ -6,17 +6,17 @@ on: [push, pull_request]
jobs:
build:
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint Ansible Playbook
uses: ansible/ansible-lint-action@master
- name: Checkout git repo
uses: actions/checkout@v4
with:
targets: "."
# [required]
# Paths to ansible files (i.e., playbooks, tasks, handlers etc..)
args: ""
# [optional]
submodules: true
fetch-depth: 0
- name: Run ansible-lint
uses: ansible-actions/ansible-lint-action@v1.0.2
with:
target: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check ubuntu:bionic
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with ubuntu:bionic
uses: roles-ansible/check-ansible-ubuntu-bionic-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check ubuntu:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with ubuntu:latest
uses: roles-ansible/check-ansible-ubuntu-latest-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check ubuntu:trusty
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with ubuntu:trusty
uses: roles-ansible/check-ansible-ubuntu-trusty-action@master
with:
targets: "./"

View file

@ -1,20 +1,24 @@
---
name: Galaxy release
name: Galaxy-NG Roles Import
# yamllint disable-line rule:truthy
on:
push:
branches: ['main']
release:
types: ['created']
jobs:
build:
name: Galaxy Role Importer
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
- name: 'Checkout git repo'
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: 'Release on galaxy'
uses: ansible-actions/ansible-galaxy-action@v1.1.1
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}

22
.github/workflows/j2lint-check.yml vendored Normal file
View file

@ -0,0 +1,22 @@
---
name: Jinja2 Linting check
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
name: Jinja2 Linting
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Run j2lint
uses: ansible-actions/j2lint-action@v0.0.1
with:
target: "./"

22
.github/workflows/yamllint-check.yml vendored Normal file
View file

@ -0,0 +1,22 @@
---
name: Yamllint check
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
name: Yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Run yamllint
uses: ansible-actions/yamllint-action@v0.0.1
with:
target: "./"

View file

@ -1,22 +0,0 @@
---
name: 'Yamllint GitHub Actions'
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
yamllint:
name: 'Yamllint'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: 'Yamllint'
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: '.'
yamllint_config_filepath: './.yamllint'
yamllint_strict: false
yamllint_comment: true
# env:
# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }

View file

@ -1,7 +1,7 @@
---
- name: update initramfs
- name: Run update initramfs
become: true
listen: update initrd
ansible.builtin.command:
cmd: >
update-initramfs -k all -u
changed_when: false

View file

@ -2,18 +2,21 @@
galaxy_info:
role_name: amdgpu_firmware
author: do1jlr
namespace: l3d
description: Ansible role to install some missing amdgpu Firmware for my AMD Thinkpad
license: "MIT"
min_ansible_version: 2.11
github_branch: main
min_ansible_version: '2.13'
platforms:
- name: Debian
versions: all
versions: ['all']
- name: Ubuntu
versions: all
versions: ['all']
galaxy_tags:
- apu
- firmware
- rtl
- nic
- amd
- amdgpu
- linux
dependencies: []

16
tasks/firmware.yml Normal file
View file

@ -0,0 +1,16 @@
---
- name: Install firmware packages
become: true
ansible.builtin.package:
name: "{{ item }}"
state: 'present'
loop:
- 'firmware-linux'
- 'firmware-linux-free'
- 'firmware-linux-nonfree'
- 'firmware-misc-nonfree'
- 'fwupd'
- 'fwupd-amd64-signed'
- 'fwupd-doc'
- 'fwupd-unsigned'
- 'gnome-firmware'

View file

@ -1,21 +1,21 @@
---
- name: "create {{ amdgpu__path_prefix }}/{{ amdgpu__path_suffix }}"
- name: "Create directory for firmware"
become: true
ansible.builtin.file:
path: "{{ amdgpu__path_prefix }}/{{ item }}"
state: directory
mode: 0755
owner: root
group: root
with_items: "{{ amdgpu__path_suffix }}"
state: 'directory'
mode: '0755'
owner: 'root'
group: 'root'
loop: "{{ amdgpu__path_suffix }}"
- name: download amdgpu firmware
- name: Download amdgpu firmware
become: true
ansible.builtin.get_url:
url: "{{ amdgpu__download_prefix }}/{{ item }}"
dest: "{{ amdgpu__path_prefix }}/{{ item }}"
owner: root
group: root
mode: 0644
with_items: "{{ amdgpu__firmware }}"
notify: update initrd
owner: 'root'
group: 'root'
mode: '0644'
loop: "{{ amdgpu__firmware }}"
notify: 'Run update initramfs'

View file

@ -1,9 +1,16 @@
---
- name: run optional versioncheck
ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
- name: Run optional versioncheck
ansible.builtin.include_tasks:
file: 'versioncheck.yml'
when:
- submodules_versioncheck | bool
- name: download additional firmware on apu board
ansible.builtin.include_tasks: kernel_firmware_download.yml
- name: Install some firmware packages
ansible.builtin.include_tasks:
file: 'firmware.yml'
- name: Download additional firmware on apu board
ansible.builtin.include_tasks:
file: 'kernel_firmware_download.yml'
when:
- ansible_processor[1] == 'AuthenticAMD'

View file

@ -7,24 +7,23 @@
ansible.builtin.file:
path: '/etc/.ansible-version'
state: directory
mode: 0755
mode: '0755'
when: submodules_versioncheck | bool
- name: check playbook version
- name: Check playbook version
become: true
ansible.builtin.slurp:
src: "/etc/.ansible-version/{{ playbook_version_path }}"
register: playbook_version
when: submodules_versioncheck | bool
ignore_errors: true
failed_when: false
- name: Print remote role version
- name: Print remote role version # noqa: H500
ansible.builtin.debug:
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
when: submodules_versioncheck | bool
- name: Print locale role version
- name: Print locale role version # noqa: H500
ansible.builtin.debug:
msg: "Local role version: '{{ playbook_version_number | string }}'."
when: submodules_versioncheck | bool
@ -35,10 +34,11 @@
when:
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck | bool
- name: write new version to remote disk
- name: Write new version to remote disk
become: true
ansible.builtin.copy:
content: "{{ playbook_version_number }}"
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
mode: '0644'
when: submodules_versioncheck | bool
tags: skip_ansible_lint_template-instead-of-copy