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:
parent
ef4387852d
commit
a08424387e
@ -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 }}"
|
||||||
|
@ -3,3 +3,4 @@ Sphinx>=1.1.2,<1.2
|
|||||||
oslosphinx
|
oslosphinx
|
||||||
bashate>=0.2
|
bashate>=0.2
|
||||||
PyYAML
|
PyYAML
|
||||||
|
ansible-lint
|
||||||
|
4
tox.ini
4
tox.ini
@ -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}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user