Skip to content

Commit

Permalink
Add ansible-lint
Browse files Browse the repository at this point in the history
* Add ansible-lint CI pipeline.
* Configure min profile.
* Fixup linting issues.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed Oct 30, 2023
1 parent 5ebd87f commit 9950e93
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
profile: min
exclude_paths:
- roles/caddy
- roles/cloudalchemy.blackbox-exporter
Expand All @@ -10,5 +11,5 @@ exclude_paths:
- roles/jnv.unattended-upgrades
- roles/nickjj.docker
skip_list:
- 701 # No 'galaxy_info' found, not needed.
- 106 # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern'
- "701" # No 'galaxy_info' found, not needed.
- "106" # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern'
27 changes: 27 additions & 0 deletions .github/workflows/ansible-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Ansible CI
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
paths:
- ansible/**
- .github/workflows/ansible-ci.yml
workflow_dispatch:

env:
ANSIBLE_FORCE_COLOR: true
ANSIBLE_GALAXY_SERVER_GALAXY_URL: "https://galaxy.ansible.com"
ANSIBLE_GALAXY_SERVER_GALAXY_TIMEOUT: 120
ANSIBLE_GALAXY_SERVER_LIST: "galaxy"

jobs:
ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint collection
uses: ansible/ansible-lint@main
2 changes: 1 addition & 1 deletion roles/mediawiki/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
mode: 0755

- name: extract mediawiki
unarchive: # noqa 208
unarchive: # noqa risky-file-permissions
src: "/tmp/mediawiki-{{ mediawiki_version }}.tar.gz"
dest: "/srv/mediawiki/{{ mediawiki.domain }}"
owner: "{{ mediawiki.system_user }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/tor/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: install tor debian repository
items:
with_items:
- 'deb http://deb.torproject.org/torproject.org jessie main'
- 'deb-src http://deb.torproject.org/torproject.org jessie main'
apt_repository:
Expand All @@ -18,7 +18,7 @@
- gnupg

- name: install tor
items:
with_items:
- tor
- deb.torproject.org-keyring
apt:
Expand Down
2 changes: 1 addition & 1 deletion roles/utils/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
lineinfile:
dest: /etc/sudoers
regexp: "^%sudo"
line: "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" # noqa 203
line: "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" # noqa no-tabs
state: present
mode: 0440

0 comments on commit 9950e93

Please sign in to comment.