Skip to content

Commit

Permalink
Merge pull request #980 from mkllnk/ansible-lint
Browse files Browse the repository at this point in the history
Run ansible-lint on CI again
  • Loading branch information
mkllnk authored Jan 8, 2025
2 parents fbb1962 + 61cc719 commit 0f10ed7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ on:
pull_request:

jobs:
#ansible-lint:
# runs-on: ubuntu-20.04
ansible-lint:
runs-on: ubuntu-20.04

# steps:
# - uses: actions/checkout@v3
steps:
- uses: actions/checkout@v3

# - uses: actions/setup-python@v4
# with:
# python-version: '3.10.15'
- uses: actions/setup-python@v4
with:
python-version: '3.10.15'

# - name: Set up Ansible
# run: |
# pip install -r requirements.txt
# bin/setup
- name: Set up Ansible
run: |
pip install -r requirements.txt
bin/setup
# - name: Ansible Lint
# run: ansible-lint playbooks/*.yml --exclude community
- name: Ansible Lint
run: bin/lint

playbook-tests:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion bin/lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

exec ansible-lint site.yml playbooks/*.yml --exclude community
exec ansible-lint site.yml playbooks/*.yml --exclude community --profile=min --offline
2 changes: 1 addition & 1 deletion playbooks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
tags: newrelic

tasks:
- name: Fix Ruby # noqa 301
- name: Fix Ruby # no-changed-when
command:
cmd: bash -lc "rbenv uninstall -f {{ ruby_version }} && rbenv install {{ ruby_version }} && touch ~/.rbenv/versions/{{ ruby_version }}/.reinstalled"
creates: "~/.rbenv/versions/{{ ruby_version }}/.reinstalled"
Expand Down
2 changes: 1 addition & 1 deletion playbooks/restore_backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
remote_user: "{{ app_user }}"

tasks:
- name: restore backup # noqa 301
- name: restore backup # no-changed-when
command: "{{ bundle_path }} exec rake db2fog:restore"
args:
chdir: "{{ current_path }}"
7 changes: 2 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# https://github.com/ansible-community/ansible-build-data
ansible==8.5.0

# This version doesn't work with the current Ansible version.
# But upgrading seems to break the build.
# TODO: upgrade ans fix ansible-lint
#ansible-lint==4.2.0
yamllint==1.21.0
ansible-lint==6.22.2
yamllint
jinja2<3.1

0 comments on commit 0f10ed7

Please sign in to comment.