From 229695989428903c0cc150fafc810f87439d7b22 Mon Sep 17 00:00:00 2001 From: Techno Tim Date: Sun, 28 Aug 2022 20:36:05 -0500 Subject: [PATCH] fix(ci): Fix Linting (#61) --- .github/workflows/lint.yml | 23 +++++++++++------------ roles/k3s/master/tasks/main.yml | 1 + roles/raspberrypi/tasks/prereq/CentOS.yml | 1 + roles/raspberrypi/tasks/prereq/Ubuntu.yml | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 86f3c34..9d29aa9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,31 +1,30 @@ --- -name: Lint -'on': +name: Linting +on: pull_request: push: branches: - master jobs: - - test: - name: Lint + ansible-lint: + name: YAML Lint + Ansible Lint runs-on: ubuntu-latest steps: - - name: Check out the codebase. - uses: actions/checkout@v2 + - name: Check out the codebase + uses: actions/checkout@v3 - - name: Set up Python 3.7. - uses: actions/setup-python@v2 + - name: Set up Python 3.x + uses: actions/setup-python@v4 with: python-version: '3.x' - - name: Install test dependencies. + - name: Install test dependencies run: pip3 install yamllint ansible-lint ansible - - name: Run yamllint. + - name: Run yamllint run: yamllint . - - name: Run ansible-lint. + - name: Run ansible-lint run: ansible-lint diff --git a/roles/k3s/master/tasks/main.yml b/roles/k3s/master/tasks/main.yml index 5d6e631..2efb265 100644 --- a/roles/k3s/master/tasks/main.yml +++ b/roles/k3s/master/tasks/main.yml @@ -66,6 +66,7 @@ name: k3s-init state: stopped failed_when: false + when: not ansible_check_mode - name: Copy K3s service file register: k3s_service diff --git a/roles/raspberrypi/tasks/prereq/CentOS.yml b/roles/raspberrypi/tasks/prereq/CentOS.yml index af83564..f12bbf8 100644 --- a/roles/raspberrypi/tasks/prereq/CentOS.yml +++ b/roles/raspberrypi/tasks/prereq/CentOS.yml @@ -6,3 +6,4 @@ regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$' line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' notify: reboot + when: not ansible_check_mode diff --git a/roles/raspberrypi/tasks/prereq/Ubuntu.yml b/roles/raspberrypi/tasks/prereq/Ubuntu.yml index fa5412f..8b580ae 100644 --- a/roles/raspberrypi/tasks/prereq/Ubuntu.yml +++ b/roles/raspberrypi/tasks/prereq/Ubuntu.yml @@ -6,7 +6,8 @@ regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$' line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' notify: reboot + when: not ansible_check_mode - name: Install linux-modules-extra-raspi apt: name=linux-modules-extra-raspi state=present - when: raspberry_pi + when: (raspberry_pi) and (not ansible_check_mode)