From bb1d4acbc028c0a5810c55634ad6712a6f70e35c Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 31 Jul 2023 12:05:34 +0200 Subject: [PATCH 1/2] Yamllint this ansible role + Create .yamllint config + improving some yamllint suggestions --- .yamllint | 10 ++++++++++ meta/main.yml | 2 +- tasks/rbd.yml | 2 -- vars/Archlinux.yml | 2 +- vars/RedHat.yml | 6 +++--- 5 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..4881d28 --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +--- +extends: default + +rules: + # 150 chars should be enough, but don't fail if a line is longer + line-length: + max: 180 + level: warning + truthy: + allowed-values: ['true', 'false', 'True', 'False', 'yes', 'no'] diff --git a/meta/main.yml b/meta/main.yml index 583e3fa..d223e5f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,6 +1,6 @@ --- galaxy_info: - #role_name: libvirt_host + # role_name: libvirt_host author: Mark Goddard description: > Role to install and configure a host as a Libvirt/KVM hypervisor diff --git a/tasks/rbd.yml b/tasks/rbd.yml index f14fbca..3d7b9d2 100644 --- a/tasks/rbd.yml +++ b/tasks/rbd.yml @@ -30,5 +30,3 @@ - name: Flush handlers meta: flush_handlers - - diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml index f80992a..16d6e8d 100644 --- a/vars/Archlinux.yml +++ b/vars/Archlinux.yml @@ -3,7 +3,7 @@ libvirt_host_libvirt_packages_default: - libvirt - qemu-headless - - ebtables + - ebtables - dnsmasq # List of default client packages to install. diff --git a/vars/RedHat.yml b/vars/RedHat.yml index a389c3d..494c729 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -19,8 +19,8 @@ libvirt_host_libvirt_packages_client_default: # Packages that are only necessary if you require EFI support libvirt_host_packages_efi_by_version: 7: - - edk2.git-ovmf-x64 # Official OVMF package doesn't boot (CentOS 7.5) - - qemu-kvm-ev # Need smm support for secure boot + - edk2.git-ovmf-x64 # Official OVMF package doesn't boot (CentOS 7.5) + - qemu-kvm-ev # Need smm support for secure boot 8: - edk2-ovmf 9: @@ -67,4 +67,4 @@ libvirt_host_lineinfile_extra_rules: insertafter: '^#LIBVIRTD_ARGS=' regexp: '^LIBVIRTD_ARGS=' line: LIBVIRTD_ARGS="{{ libvirt_host_libvirtd_args }}" - condition: "{{ libvirt_host_libvirtd_args != '' }}" + condition: "{{ libvirt_host_libvirtd_args != '' }}" From 55a71d642b2561a4fcbc4b6fe15362786380d18d Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 31 Jul 2023 12:07:52 +0200 Subject: [PATCH 2/2] Adding Yamllint Github Action --- .github/workflows/yamllint.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/yamllint.yml diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml new file mode 100644 index 0000000..94b9d77 --- /dev/null +++ b/.github/workflows/yamllint.yml @@ -0,0 +1,20 @@ +--- +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@v3.5.3 + - name: 'Yamllint' + uses: karancode/yamllint-github-action@v2.1.1 + with: + yamllint_file_or_dir: '.' + yamllint_config_filepath: './.yamllint' + yamllint_strict: false + yamllint_comment: true