From 7f39181f95cf4f0436b8ce3ef7c130ecd4c3e302 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 20 Jan 2021 19:57:04 +0100 Subject: [PATCH] update yaml linting, actions and meta info --- .github/FUNDING.yml | 4 +- .github/workflows/ansible-alpine-latest.yml | 18 ++++++++ .../workflows/ansible-archlinux-latest.yml | 18 ++++++++ .github/workflows/ansible-centos-centos7.yml | 12 ++--- .github/workflows/ansible-centos-centos8.yml | 12 ++--- .github/workflows/ansible-centos-latest.yml | 12 ++--- .github/workflows/ansible-debian-buster.yml | 12 ++--- .github/workflows/ansible-debian-latest.yml | 18 ++++++++ .github/workflows/ansible-debian-sid.yml | 12 ++--- .github/workflows/ansible-debian-stable.yml | 12 ++--- .github/workflows/ansible-debian-stretch.yml | 12 ++--- .github/workflows/ansible-fedora-31.yml | 18 ++++++++ .github/workflows/ansible-fedora-32.yml | 18 ++++++++ .github/workflows/ansible-fedora-33.yml | 18 ++++++++ .github/workflows/ansible-fedora-latest.yml | 18 ++++++++ .github/workflows/ansible-linting-check.yml | 22 ++++++++++ .github/workflows/ansible-linting-chek.yml | 20 --------- .github/workflows/ansible-ubuntu-bionic.yml | 12 ++--- .github/workflows/ansible-ubuntu-latest.yml | 12 ++--- .github/workflows/ansible-ubuntu-trusty.yml | 12 ++--- .github/workflows/yamllint.yaml | 22 ++++++++++ .yamllint | 8 ++++ README.md | 8 ++-- meta/main.yml | 44 +++++-------------- 24 files changed, 267 insertions(+), 107 deletions(-) create mode 100644 .github/workflows/ansible-alpine-latest.yml create mode 100644 .github/workflows/ansible-archlinux-latest.yml create mode 100644 .github/workflows/ansible-debian-latest.yml create mode 100644 .github/workflows/ansible-fedora-31.yml create mode 100644 .github/workflows/ansible-fedora-32.yml create mode 100644 .github/workflows/ansible-fedora-33.yml create mode 100644 .github/workflows/ansible-fedora-latest.yml create mode 100644 .github/workflows/ansible-linting-check.yml delete mode 100644 .github/workflows/ansible-linting-chek.yml create mode 100644 .github/workflows/yamllint.yaml create mode 100644 .yamllint diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 51ba466..8f96dfd 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,6 @@ -# These are supported funding model platforms +--- +# Feel free to add yourself if you maintain this repo +# or participate in a way that you have the feeling that you belong there ;-) github: [do1jlr] liberapay: L3D diff --git a/.github/workflows/ansible-alpine-latest.yml b/.github/workflows/ansible-alpine-latest.yml new file mode 100644 index 0000000..07bfff0 --- /dev/null +++ b/.github/workflows/ansible-alpine-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check alpine: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 alpine:latest + uses: roles-ansible/check-ansible-alpine-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-archlinux-latest.yml b/.github/workflows/ansible-archlinux-latest.yml new file mode 100644 index 0000000..e823f0c --- /dev/null +++ b/.github/workflows/ansible-archlinux-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check archlinux: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 archlinux:latest + uses: roles-ansible/check-ansible-archlinux-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-centos7.yml b/.github/workflows/ansible-centos-centos7.yml index 90bff41..401d2c0 100644 --- a/.github/workflows/ansible-centos-centos7.yml +++ b/.github/workflows/ansible-centos-centos7.yml @@ -1,5 +1,7 @@ +--- name: Ansible check centos:centos7 +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with ubuntu:centos7 - uses: roles-ansible/check-ansible-centos-centos7-action@master - with: - targets: "./" + - name: ansible check with ubuntu:centos7 + uses: roles-ansible/check-ansible-centos-centos7-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-centos8.yml b/.github/workflows/ansible-centos-centos8.yml index 5d7acc9..f20097b 100644 --- a/.github/workflows/ansible-centos-centos8.yml +++ b/.github/workflows/ansible-centos-centos8.yml @@ -1,5 +1,7 @@ +--- name: Ansible check centos:centos8 +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with ubuntu:centos8 - uses: roles-ansible/check-ansible-centos-centos8-action@master - with: - targets: "./" + - name: ansible check with ubuntu:centos8 + uses: roles-ansible/check-ansible-centos-centos8-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-latest.yml b/.github/workflows/ansible-centos-latest.yml index de991de..94eb54b 100644 --- a/.github/workflows/ansible-centos-latest.yml +++ b/.github/workflows/ansible-centos-latest.yml @@ -1,5 +1,7 @@ +--- name: Ansible check centos:latest +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with ubuntu:latest - uses: roles-ansible/check-ansible-centos-latest-action@master - with: - targets: "./" + - name: ansible check with ubuntu:latest + uses: roles-ansible/check-ansible-centos-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-buster.yml b/.github/workflows/ansible-debian-buster.yml index a7650ad..d76b02c 100644 --- a/.github/workflows/ansible-debian-buster.yml +++ b/.github/workflows/ansible-debian-buster.yml @@ -1,5 +1,7 @@ +--- name: Ansible check debian:buster +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with debian:buster - uses: roles-ansible/check-ansible-debian-buster-action@master - with: - targets: "./" + - name: ansible check with debian:buster + uses: roles-ansible/check-ansible-debian-buster-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-latest.yml b/.github/workflows/ansible-debian-latest.yml new file mode 100644 index 0000000..f7eb5b6 --- /dev/null +++ b/.github/workflows/ansible-debian-latest.yml @@ -0,0 +1,18 @@ +--- +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: "./" diff --git a/.github/workflows/ansible-debian-sid.yml b/.github/workflows/ansible-debian-sid.yml index 72fe3a8..2e3215a 100644 --- a/.github/workflows/ansible-debian-sid.yml +++ b/.github/workflows/ansible-debian-sid.yml @@ -1,5 +1,7 @@ +--- name: Ansible check debian:sid +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with debian:sid - uses: roles-ansible/check-ansible-debian-sid-action@master - with: - targets: "./" + - name: ansible check with debian:sid + uses: roles-ansible/check-ansible-debian-sid-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-stable.yml b/.github/workflows/ansible-debian-stable.yml index 97076ae..e47f773 100644 --- a/.github/workflows/ansible-debian-stable.yml +++ b/.github/workflows/ansible-debian-stable.yml @@ -1,5 +1,7 @@ +--- name: Ansible check debian:stable +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with debian:stable - uses: roles-ansible/check-ansible-debian-stable-action@master - with: - targets: "./" + - name: ansible check with debian:stable + uses: roles-ansible/check-ansible-debian-stable-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-stretch.yml b/.github/workflows/ansible-debian-stretch.yml index 19ac5fb..c947cae 100644 --- a/.github/workflows/ansible-debian-stretch.yml +++ b/.github/workflows/ansible-debian-stretch.yml @@ -1,5 +1,7 @@ +--- name: Ansible check debian:stretch +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with debian:stretch - uses: roles-ansible/check-ansible-debian-stretch-action@master - with: - targets: "./" + - name: ansible check with debian:stretch + uses: roles-ansible/check-ansible-debian-stretch-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-31.yml b/.github/workflows/ansible-fedora-31.yml new file mode 100644 index 0000000..08502fe --- /dev/null +++ b/.github/workflows/ansible-fedora-31.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora:31 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:31 + uses: roles-ansible/check-ansible-fedora-31-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-32.yml b/.github/workflows/ansible-fedora-32.yml new file mode 100644 index 0000000..e362dd4 --- /dev/null +++ b/.github/workflows/ansible-fedora-32.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora:32 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:32 + uses: roles-ansible/check-ansible-fedora-32-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-33.yml b/.github/workflows/ansible-fedora-33.yml new file mode 100644 index 0000000..70c52ad --- /dev/null +++ b/.github/workflows/ansible-fedora-33.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora:33 + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:33 + uses: roles-ansible/check-ansible-fedora-33-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-latest.yml b/.github/workflows/ansible-fedora-latest.yml new file mode 100644 index 0000000..7cfbdf7 --- /dev/null +++ b/.github/workflows/ansible-fedora-latest.yml @@ -0,0 +1,18 @@ +--- +name: Ansible check fedora: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 fedora:latest + uses: roles-ansible/check-ansible-fedora-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml new file mode 100644 index 0000000..41dcb97 --- /dev/null +++ b/.github/workflows/ansible-linting-check.yml @@ -0,0 +1,22 @@ +--- +name: Ansible Lint check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Lint Ansible Playbook + uses: ansible/ansible-lint-action@master + with: + targets: "." + # [required] + # Paths to ansible files (i.e., playbooks, tasks, handlers etc..) + args: "" + # [optional] diff --git a/.github/workflows/ansible-linting-chek.yml b/.github/workflows/ansible-linting-chek.yml deleted file mode 100644 index 712c76f..0000000 --- a/.github/workflows/ansible-linting-chek.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Ansible Lint check - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Lint Ansible Playbook - uses: ansible/ansible-lint-action@master - with: - targets: "." - # [required] - # Paths to ansible files (i.e., playbooks, tasks, handlers etc..) - args: "" - # [optional] diff --git a/.github/workflows/ansible-ubuntu-bionic.yml b/.github/workflows/ansible-ubuntu-bionic.yml index aea24a2..0f9edd8 100644 --- a/.github/workflows/ansible-ubuntu-bionic.yml +++ b/.github/workflows/ansible-ubuntu-bionic.yml @@ -1,5 +1,7 @@ +--- name: Ansible check ubuntu:bionic +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with ubuntu:bionic - uses: roles-ansible/check-ansible-ubuntu-bionic-action@master - with: - targets: "./" + - name: ansible check with ubuntu:bionic + uses: roles-ansible/check-ansible-ubuntu-bionic-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-latest.yml b/.github/workflows/ansible-ubuntu-latest.yml index 2e34685..b9544a5 100644 --- a/.github/workflows/ansible-ubuntu-latest.yml +++ b/.github/workflows/ansible-ubuntu-latest.yml @@ -1,5 +1,7 @@ +--- name: Ansible check ubuntu:latest +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with ubuntu:latest - uses: roles-ansible/check-ansible-ubuntu-latest-action@master - with: - targets: "./" + - name: ansible check with ubuntu:latest + uses: roles-ansible/check-ansible-ubuntu-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-trusty.yml b/.github/workflows/ansible-ubuntu-trusty.yml index a18c397..6cde8b8 100644 --- a/.github/workflows/ansible-ubuntu-trusty.yml +++ b/.github/workflows/ansible-ubuntu-trusty.yml @@ -1,5 +1,7 @@ +--- name: Ansible check ubuntu:trusty +# yamllint disable-line rule:truthy on: [push, pull_request] jobs: @@ -8,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: ansible check with ubuntu:trusty - uses: roles-ansible/check-ansible-ubuntu-trusty-action@master - with: - targets: "./" + - name: ansible check with ubuntu:trusty + uses: roles-ansible/check-ansible-ubuntu-trusty-action@master + with: + targets: "./" diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml new file mode 100644 index 0000000..39c49f8 --- /dev/null +++ b/.github/workflows/yamllint.yaml @@ -0,0 +1,22 @@ +--- +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 } diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..cb32cb1 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + # 150 chars should be enough, but don't fail if a line is longer + line-length: + max: 150 + level: warning diff --git a/README.md b/README.md index dcefa69..ccc6ff8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Example playbook: --- - hosts: localhost roles: - - { role: do1jlr.ansible_version, tags: [default,version,default], gather_facts: no} + - { role: do1jlr.ansible_version, tags: [default,version,always], gather_facts: false } ``` **Without ansible galaxy:** @@ -42,10 +42,12 @@ Your Playbook could look like this: - name: check if ansible is not to old hosts: localhost tags: - - default + - default + - version + - always roles: - ansible_version - gather_facts: no + gather_facts: false ``` Modifications diff --git a/meta/main.yml b/meta/main.yml index 2428d7b..0d121bd 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -10,43 +10,21 @@ galaxy_info: - name: Archlinux versions: all - name: Debian - versions: - - sid - - buster - - jessie - - stretch + versions: all - name: Ubuntu - versions: - - bionic - - disco - - eoan - - focal - - trusty - - xenial -# - name: Alpine -# version: -# - 3.10 -# - 3.9 -# - 3.8 -# - name: Clearlinux -# version: -# - all + versions: all + - name: Alpine + version: all - name: EL - versions: - - 8 - - 7 - - 6 -# - name: Fedora -# versions: -# - 31 -# - 30 -# - 29 -# - 28 -## - name: Suse -# versions: -## - 15 + versions: all + - name: Fedora + versions: all + - name: Suse + versions: all galaxy_tags: - version - playbook - versioncheck + - always + - ansible_version dependencies: []