Skip to content

Commit

Permalink
Merge pull request #2 from voidquark/add-lint
Browse files Browse the repository at this point in the history
add ansible and yaml lint
  • Loading branch information
voidquark authored Aug 14, 2024
2 parents dfcb573 + c737b74 commit 35917a0
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
skip_list:
- 'yaml'
- 'package-latest'
28 changes: 28 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Lint
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: pip3 install yamllint

- name: Run Yaml Lint
run: |
yamllint .
- name: Run Ansible Lint
uses: ansible/ansible-lint@main
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default

rules:
line-length:
max: 230
level: warning
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ el_patching_auto_reboot: false
# el_patching_exclude_packages:
# - tar
# - zip
# el_patching_update_cache: true
# el_patching_update_cache: true
3 changes: 2 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
galaxy_info:
author: voidquark
description: Apply Linux OS patches
Expand All @@ -14,4 +15,4 @@ galaxy_info:
- name: EL
versions:
- "8"
- "9"
- "9"
3 changes: 2 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
cmd: needs-restarting --reboothint
register: __el_patching_need_restart
failed_when: __el_patching_need_restart.rc > 1
changed_when: false

- name: Inform user if reboot is required
ansible.builtin.debug:
Expand All @@ -46,4 +47,4 @@
- name: Reboot host
ansible.builtin.reboot:
reboot_timeout: "{{ el_patching_reboot_timeout }}"
when: el_patching_auto_reboot | bool and __el_patching_need_restart.rc == 1
when: el_patching_auto_reboot | bool and __el_patching_need_restart.rc == 1

0 comments on commit 35917a0

Please sign in to comment.