Merge "Run ansible-lint on playbooks"

This commit is contained in:
Jenkins 2017-01-13 16:56:36 +00:00 committed by Gerrit Code Review
commit e200c17c6d
3 changed files with 11 additions and 6 deletions

View File

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

View File

@ -9,11 +9,15 @@ install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
[testenv:linters] [testenv:linters]
whitelist_externals = bash
commands = commands =
flake8 flake8
{toxinidir}/tools/run-bashate.sh {toxinidir}/tools/run-bashate.sh
python {toxinidir}/tools/sorted_modules_env.py {toxinidir}/modules.env python {toxinidir}/tools/sorted_modules_env.py {toxinidir}/modules.env
python {toxinidir}/tools/irc_checks.py 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] [testenv:venv]
commands = {posargs} commands = {posargs}