CI: Fix ansible-lint search space
This patch will allow ansible-lint to search for files on its own instead of *.yml files in the root directory. Since playbooks now reside in their own folder, ansible-lint would not lint any roles anymore. Also this introduces another small stub ansible-lint related ansible config file, so it does not always try to use the vault password / decrypt files.
This commit is contained in:
parent
1419627c1c
commit
8286c3afd3
3 changed files with 4 additions and 2 deletions
|
@ -13,7 +13,7 @@ ansible-lint:
|
||||||
stage: lint
|
stage: lint
|
||||||
script:
|
script:
|
||||||
- ansible-lint --version
|
- ansible-lint --version
|
||||||
- ansible-lint -f codeclimate *.yml > ansible-lint-report.json
|
- ANSIBLE_CONFIG=ansible.lint.cfg ansible-lint -f codeclimate > ansible-lint-report.json
|
||||||
artifacts:
|
artifacts:
|
||||||
reports:
|
reports:
|
||||||
codequality: ansible-lint-report.json
|
codequality: ansible-lint-report.json
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ help: ## Show this help
|
||||||
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
lint: ## Lint ansible files with ansible-lint
|
lint: ## Lint ansible files with ansible-lint
|
||||||
ansible-lint
|
ANSIBLE_CONFIG=ansible.lint.cfg ansible-lint
|
||||||
|
|
||||||
install: ## Install or update requirements
|
install: ## Install or update requirements
|
||||||
ansible-galaxy install -f -r requirements.yml
|
ansible-galaxy install -f -r requirements.yml
|
||||||
|
|
2
ansible.lint.cfg
Normal file
2
ansible.lint.cfg
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Empty stub config file, so ansible-lint does not use the default config's vault_password_file.
|
||||||
|
# Otherwise ansible-lint always tries to get a vault password and fails.
|
Loading…
Add table
Reference in a new issue