From 8ce3f049257c45a5f75513b009f4a83467d5c574 Mon Sep 17 00:00:00 2001 From: L3D Date: Tue, 19 Jan 2021 01:03:47 +0100 Subject: [PATCH] add versionscheck and fix linting --- .github/FUNDING.yml | 6 + .github/license.svg | 217 +++++++++++++++++++ .github/workflows/ansible-debian-buster.yml | 18 ++ .github/workflows/ansible-debian-latest.yml | 18 ++ .github/workflows/ansible-debian-sid.yml | 18 ++ .github/workflows/ansible-debian-stable.yml | 18 ++ .github/workflows/ansible-debian-stretch.yml | 18 ++ .github/workflows/ansible-linting-check.yml | 22 ++ .github/workflows/ansible-ubuntu-bionic.yml | 18 ++ .github/workflows/ansible-ubuntu-latest.yml | 18 ++ .github/workflows/ansible-ubuntu-trusty.yml | 18 ++ .github/workflows/yamllint.yaml | 22 ++ .yamllint | 8 + defaults/main.yml | 2 + handlers/main.yml | 7 +- tasks/main.yml | 4 +- tasks/versioncheck.yml | 2 +- vars/main.yml | 2 +- 18 files changed, 428 insertions(+), 8 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/license.svg create mode 100644 .github/workflows/ansible-debian-buster.yml create mode 100644 .github/workflows/ansible-debian-latest.yml create mode 100644 .github/workflows/ansible-debian-sid.yml create mode 100644 .github/workflows/ansible-debian-stable.yml create mode 100644 .github/workflows/ansible-debian-stretch.yml create mode 100644 .github/workflows/ansible-linting-check.yml create mode 100644 .github/workflows/ansible-ubuntu-bionic.yml create mode 100644 .github/workflows/ansible-ubuntu-latest.yml create mode 100644 .github/workflows/ansible-ubuntu-trusty.yml create mode 100644 .github/workflows/yamllint.yaml create mode 100644 .yamllint diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..8f96dfd --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,6 @@ +--- +# 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/license.svg b/.github/license.svg new file mode 100644 index 0000000..4ab6d9a --- /dev/null +++ b/.github/license.svg @@ -0,0 +1,217 @@ + + + + + + image/svg+xml + + + + + + 3D <l3d@c3woc.de> + + + + + MIT License + + + + + + + + + + + + + + + + + + + + + + + + + + + MIT + MIT + + + license + license + + diff --git a/.github/workflows/ansible-debian-buster.yml b/.github/workflows/ansible-debian-buster.yml new file mode 100644 index 0000000..d76b02c --- /dev/null +++ b/.github/workflows/ansible-debian-buster.yml @@ -0,0 +1,18 @@ +--- +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: "./" 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 new file mode 100644 index 0000000..2e3215a --- /dev/null +++ b/.github/workflows/ansible-debian-sid.yml @@ -0,0 +1,18 @@ +--- +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: "./" diff --git a/.github/workflows/ansible-debian-stable.yml b/.github/workflows/ansible-debian-stable.yml new file mode 100644 index 0000000..e47f773 --- /dev/null +++ b/.github/workflows/ansible-debian-stable.yml @@ -0,0 +1,18 @@ +--- +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: "./" diff --git a/.github/workflows/ansible-debian-stretch.yml b/.github/workflows/ansible-debian-stretch.yml new file mode 100644 index 0000000..c947cae --- /dev/null +++ b/.github/workflows/ansible-debian-stretch.yml @@ -0,0 +1,18 @@ +--- +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: "./" 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-ubuntu-bionic.yml b/.github/workflows/ansible-ubuntu-bionic.yml new file mode 100644 index 0000000..0f9edd8 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-bionic.yml @@ -0,0 +1,18 @@ +--- +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: "./" diff --git a/.github/workflows/ansible-ubuntu-latest.yml b/.github/workflows/ansible-ubuntu-latest.yml new file mode 100644 index 0000000..b9544a5 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-latest.yml @@ -0,0 +1,18 @@ +--- +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: "./" diff --git a/.github/workflows/ansible-ubuntu-trusty.yml b/.github/workflows/ansible-ubuntu-trusty.yml new file mode 100644 index 0000000..6cde8b8 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-trusty.yml @@ -0,0 +1,18 @@ +--- +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: "./" 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/defaults/main.yml b/defaults/main.yml index 4f3d52b..ce7b7c9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,3 +5,5 @@ submodules_versioncheck: false unbound_listen_addresses: - '127.0.0.1@53' - '::1@53' + +unbound__state: 'present' diff --git a/handlers/main.yml b/handlers/main.yml index 204352d..b17118a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,11 +1,10 @@ --- - name: unbound checkconf command: unbound-checkconf /etc/unbound/unbound.conf - changed_when: True - notify: restart unbound + changed_when: true + notify: systemctl restart unbound - -- name: restart unbound +- name: systemctl restart unbound service: name: unbound state: restarted diff --git a/tasks/main.yml b/tasks/main.yml index 48c8fcc..ece361d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,8 +6,8 @@ apt: package: - unbound - state: 'latest' - update_cache: yes + state: "{{ unbound__state }}" + update_cache: true cache_valid_time: 43200 diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 7977e52..c4f3337 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -13,7 +13,7 @@ src: "/etc/.ansible-version/{{ playbook_version_path }}" register: playbook_version when: submodules_versioncheck|bool - ignore_errors: yes + ignore_errors: true failed_when: false - name: Print remote role version diff --git a/vars/main.yml b/vars/main.yml index 2e3a78b..6a7cd51 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,3 @@ --- -playbook_version_number: 64 # should be integer +playbook_version_number: 65 # should be integer playbook_version_path: 'role-unbound_roles-ansible_github.com.version'