Skip to content

Commit

Permalink
Add ansible-lint run to sanity tests
Browse files Browse the repository at this point in the history
This is the second static analysis tool that Ansible Galaxy runs on
the code when we import our collection. Which means that we should be
running it too.
  • Loading branch information
Tadej Borovšak authored and mancabizjak committed Jan 8, 2020
1 parent 337f78d commit 04a3f0a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ requirements: ## Install development requirements
.PHONY: sanity
sanity: ## Run sanity tests
flake8
ansible-lint -p roles/*
ansible-test sanity --python $(python_version)

.PHONY: units
Expand Down
3 changes: 2 additions & 1 deletion roles/backend/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@
tags: [run_backend]

- name: Check for sensu-backend init command
shell:
command:
cmd: sensu-backend init -h
register: init_command_test
failed_when: false # Never fail, we just want to know if init exists.
changed_when: false # Displaying help is read-only operation.

- name: Initialize backend
command:
Expand Down
5 changes: 4 additions & 1 deletion roles/install/tasks/apt/install.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
# Why did we kill the 403 (package installs should not use latest) check?
# Because we really do want to be able to upgrade the packages to the latest
# stable version.
- name: Install latest component version
apt:
name: "{{ item }}"
state: latest
state: latest # noqa 403
when: version == "latest"
loop: "{{ components }}"

Expand Down
5 changes: 4 additions & 1 deletion roles/install/tasks/yum/install.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
# Why did we kill the 403 (package installs should not use latest) check?
# Because we really do want to be able to upgrade the packages to the latest
# stable version.
- name: Install latest component version
yum:
name: "{{ item }}"
state: latest
state: latest # noqa 403
when: version == "latest"
loop: "{{ components }}"

Expand Down
1 change: 1 addition & 0 deletions sanity.requirements
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ansible-lint
flake8
pycodestyle
pylint
Expand Down

0 comments on commit 04a3f0a

Please sign in to comment.