Run ansible-lint on playbooks

This fixes the issues we have with our rename_repos.yaml file. We are
also skipping additional failures for now, which will be cleaned up in
a follow up patch.

Change-Id: I726535e195a292e3f2d457f0ed039d01bb96c66b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-01-12 15:32:46 -05:00
parent ef4387852d
commit a08424387e
3 changed files with 11 additions and 6 deletions

View File

@ -6,13 +6,13 @@
- shell: invoke-rc.d gerrit stop
- include_vars: "{{ repolist }}"
- shell: echo 'update account_project_watches set project_name = "{{ item.new }}" where project_name = "{{ item.old }}";' | mysql reviewdb
with_items: {{ repos }}
with_items: "{{ repos }}"
- shell: echo 'update changes set dest_project_name = "{{ item.new }}", created_on = created_on where dest_project_name = "{{ item.old }}";' | mysql reviewdb
with_items: {{ repos }}
with_items: "{{ repos }}"
- shell: mv {{ item[0] }}{{ item[1].old }}.git {{ item[0] }}{{ item[1].new }}.git
with_nested:
- [ '~gerrit2/review_site/git/', '/opt/lib/git/' ]
- {{ repos }}
- "{{ repos }}"
- hosts: 'git0*'
gather_facts: False
tasks:
@ -20,14 +20,14 @@
- shell: mv {{ item[0] }}{{ item[1].old }}.git {{ item[0] }}{{ item[1].new }}.git
with_nested:
- [ '/var/lib/git/' ]
- {{ repos }}
- "{{ repos }}"
- hosts: storyboard.openstack.org
gather_facts: False
remote_user: root
tasks:
- include_vars: "{{ repolist }}"
- shell: echo 'update projects set name="{{ item.new }}" where name="{{ item.old }}";' | mysql --defaults-file=/root/.storyboard_db.cnf storyboard
with_items: {{ repos }}
with_items: "{{ repos }}"
- hosts: review.openstack.org
gather_facts: False
remote_user: root
@ -58,4 +58,4 @@
tasks:
- include_vars: "{{ repolist }}"
- shell: 'rm -rf ~jenkins/workspace/*{{ item.old | basename }}*'
with_items: {{ repos }}
with_items: "{{ repos }}"

View File

@ -3,3 +3,4 @@ Sphinx>=1.1.2,<1.2
oslosphinx
bashate>=0.2
PyYAML
ansible-lint

View File

@ -9,11 +9,15 @@ install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
[testenv:linters]
whitelist_externals = bash
commands =
flake8
{toxinidir}/tools/run-bashate.sh
python {toxinidir}/tools/sorted_modules_env.py {toxinidir}/modules.env
python {toxinidir}/tools/irc_checks.py
# Ansible Lint Check
bash -c "find playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint -x ANSIBLE0004,ANSIBLE0006,ANSIBLE0007,ANSIBLE0011,ANSIBLE0012,ANSIBLE0013,ANSIBLE0015"
[testenv:venv]
commands = {posargs}