Add yaml and ansible linters

Before we get too carried away, let's add some linters.

This commit also fixes some linting failures in
tripleo_ipa/meta/main.yml.

Change-Id: Ic57d1b84a90ce5456812b9462c1af5539791b561
This commit is contained in:
Lance Bragstad 2020-03-18 01:22:37 +00:00
parent 5b94e15b6b
commit 477907dd72
3 changed files with 27 additions and 16 deletions

2
test-requirements.txt Normal file
View File

@ -0,0 +1,2 @@
ansible-lint
yamllint

19
tox.ini
View File

@ -1,7 +1,7 @@
[tox]
minversion = 2.0
# add docs to the list of environments once we actually have docs to generate
envlist = molecule
envlist = molecule, linters
skipdist = True
[testenv]
@ -15,3 +15,20 @@ changedir = {toxinidir}/tripleo_ipa
commands = molecule test --all
whitelist_externals =
tox
[testenv:ansible-lint]
deps = {[testenv:linters]deps}
commands =
ansible-lint {toxinidir}/tripleo_ipa
[testenv:yamllint]
deps = {[testenv:linters]deps}
commands =
yamllint -c {toxinidir}/tripleo_ipa/.yamllint {toxinidir}/tripleo_ipa
[testenv:linters]
deps =
-r {toxinidir}/test-requirements.txt
commands =
{[testenv:ansible-lint]commands}
{[testenv:yamllint]commands}

View File

@ -1,7 +1,7 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: OpenStack
description: This role is used to integrate TripleO with FreeIPA.
company: Red Hat
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
@ -27,17 +27,10 @@ galaxy_info:
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: CentOS
versions:
- 8
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
@ -50,4 +43,3 @@ galaxy_info:
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.