Add yamllint to tox -elinters

This adds and enabled strict yamllinting on our playbooks / roles.

Change-Id: Ie66ab53c7d6ed4dee1d18a30bdadd9c679549d47
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/45/624845/1
Paul Belanger 4 years ago
parent acdfa8785c
commit ec7a464e2a
  1. 13
      .yamllint
  2. 1
      .zuul.d/jobs.yaml
  3. 1
      .zuul.d/project-templates.yaml
  4. 1
      .zuul.d/projects.yaml
  5. 1
      .zuul.d/shared-jobs.yaml
  6. 1
      config/zuul/main.yaml
  7. 8
      inventory/testing/group_vars/zuul-executor.yaml
  8. 8
      inventory/testing/group_vars/zuul-fingergw.yaml
  9. 8
      inventory/testing/group_vars/zuul-merger.yaml
  10. 8
      inventory/testing/group_vars/zuul-scheduler.yaml
  11. 8
      inventory/testing/group_vars/zuul-web.yaml
  12. 4
      playbooks/bootstrap.yaml
  13. 6
      playbooks/nodepool-builder.yaml
  14. 2
      playbooks/roles/test.gear/tasks/main.yaml
  15. 4
      playbooks/roles/test.nodepool-builder/tasks/main.yaml
  16. 4
      playbooks/roles/test.nodepool-launcher/tasks/main.yaml
  17. 6
      playbooks/roles/test.prove/tasks/main.yaml
  18. 2
      playbooks/roles/test.statsd/tasks/main.yaml
  19. 2
      playbooks/roles/test.zookeeper/tasks/main.yaml
  20. 2
      playbooks/roles/test.zuul-executor/tasks/main.yaml
  21. 2
      playbooks/roles/test.zuul-fingergw/tasks/main.yaml
  22. 2
      playbooks/roles/test.zuul-merger/tasks/main.yaml
  23. 2
      playbooks/roles/test.zuul-scheduler/tasks/main.yaml
  24. 2
      playbooks/roles/test.zuul-web/tasks/main.yaml
  25. 2
      playbooks/zuul-executor.yaml
  26. 1
      test-requirements.txt
  27. 19
      tests/collect-logs.yaml
  28. 1
      tests/extra-vars/git.yaml
  29. 1
      tests/extra-vars/pip.yaml
  30. 1
      tests/playbooks/molecule/post.yaml
  31. 1
      tests/playbooks/molecule/pre.yaml
  32. 1
      tests/playbooks/post.yaml
  33. 5
      tests/playbooks/pre.yaml
  34. 1
      tests/playbooks/run.yaml
  35. 1
      tests/playbooks/windmill-tox-with-sudo/run.yaml
  36. 1
      tools/requirements.yaml
  37. 1
      tox.ini

@ -0,0 +1,13 @@
extends: default
ignore: |
.tox
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
line-length: disable

@ -1,3 +1,4 @@
---
- job:
name: windmill-base
pre-run: tests/playbooks/pre.yaml

@ -1,3 +1,4 @@
---
- project-template:
name: windmill-jobs-fedora-latest
check:

@ -1,3 +1,4 @@
---
- project:
templates:
- ansible-role-jobs

@ -1,4 +1,5 @@
# TODO(pabelanger): Remove once https://review.openstack.org/593150 is merged.
---
- job:
name: windmill-tox-with-sudo
parent: tox

@ -1,5 +1,6 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
---
- tenant:
name: example

@ -27,19 +27,19 @@ zuul_file_zuul_scheduler_service_manage: false
zuul_file_zuul_web_service_config_manage: false
zuul_file_zuul_web_service_manage: false
zuul_service_zuul_fingergw_enabled: no
zuul_service_zuul_fingergw_enabled: false
zuul_service_zuul_fingergw_manage: false
zuul_service_zuul_fingergw_state: stopped
zuul_service_zuul_merger_enabled: no
zuul_service_zuul_merger_enabled: false
zuul_service_zuul_merger_manage: false
zuul_service_zuul_merger_state: stopped
zuul_service_zuul_scheduler_enabled: no
zuul_service_zuul_scheduler_enabled: false
zuul_service_zuul_scheduler_manage: false
zuul_service_zuul_scheduler_state: stopped
zuul_service_zuul_web_enabled: no
zuul_service_zuul_web_enabled: false
zuul_service_zuul_web_manage: false
zuul_service_zuul_web_state: stopped

@ -25,19 +25,19 @@ zuul_file_zuul_scheduler_service_manage: false
zuul_file_zuul_web_service_config_manage: false
zuul_file_zuul_web_service_manage: false
zuul_service_zuul_executor_enabled: no
zuul_service_zuul_executor_enabled: false
zuul_service_zuul_executor_manage: false
zuul_service_zuul_executor_state: stopped
zuul_service_zuul_merger_enabled: no
zuul_service_zuul_merger_enabled: false
zuul_service_zuul_merger_manage: false
zuul_service_zuul_merger_state: stopped
zuul_service_zuul_scheduler_enabled: no
zuul_service_zuul_scheduler_enabled: false
zuul_service_zuul_scheduler_manage: false
zuul_service_zuul_scheduler_state: stopped
zuul_service_zuul_web_enabled: no
zuul_service_zuul_web_enabled: false
zuul_service_zuul_web_manage: false
zuul_service_zuul_web_state: stopped

@ -27,19 +27,19 @@ zuul_file_zuul_scheduler_service_manage: false
zuul_file_zuul_web_service_config_manage: false
zuul_file_zuul_web_service_manage: false
zuul_service_zuul_executor_enabled: no
zuul_service_zuul_executor_enabled: false
zuul_service_zuul_executor_manage: false
zuul_service_zuul_executor_state: stopped
zuul_service_zuul_fingergw_enabled: no
zuul_service_zuul_fingergw_enabled: false
zuul_service_zuul_fingergw_manage: false
zuul_service_zuul_fingergw_state: stopped
zuul_service_zuul_scheduler_enabled: no
zuul_service_zuul_scheduler_enabled: false
zuul_service_zuul_scheduler_manage: false
zuul_service_zuul_scheduler_state: stopped
zuul_service_zuul_web_enabled: no
zuul_service_zuul_web_enabled: false
zuul_service_zuul_web_manage: false
zuul_service_zuul_web_state: stopped

@ -27,19 +27,19 @@ zuul_file_zuul_merger_service_manage: false
zuul_file_zuul_web_service_config_manage: false
zuul_file_zuul_web_service_manage: false
zuul_service_zuul_executor_enabled: no
zuul_service_zuul_executor_enabled: false
zuul_service_zuul_executor_manage: false
zuul_service_zuul_executor_state: stopped
zuul_service_zuul_fingergw_enabled: no
zuul_service_zuul_fingergw_enabled: false
zuul_service_zuul_fingergw_manage: false
zuul_service_zuul_fingergw_state: stopped
zuul_service_zuul_merger_enabled: no
zuul_service_zuul_merger_enabled: false
zuul_service_zuul_merger_manage: false
zuul_service_zuul_merger_state: stopped
zuul_service_zuul_web_enabled: no
zuul_service_zuul_web_enabled: false
zuul_service_zuul_web_manage: false
zuul_service_zuul_web_state: stopped

@ -27,19 +27,19 @@ zuul_file_zuul_merger_service_manage: false
zuul_file_zuul_scheduler_service_config_manage: false
zuul_file_zuul_scheduler_service_manage: false
zuul_service_zuul_executor_enabled: no
zuul_service_zuul_executor_enabled: false
zuul_service_zuul_executor_manage: false
zuul_service_zuul_executor_state: stopped
zuul_service_zuul_fingergw_enabled: no
zuul_service_zuul_fingergw_enabled: false
zuul_service_zuul_fingergw_manage: false
zuul_service_zuul_fingergw_state: stopped
zuul_service_zuul_merger_enabled: no
zuul_service_zuul_merger_enabled: false
zuul_service_zuul_merger_manage: false
zuul_service_zuul_merger_state: stopped
zuul_service_zuul_scheduler_enabled: no
zuul_service_zuul_scheduler_enabled: false
zuul_service_zuul_scheduler_manage: false
zuul_service_zuul_scheduler_state: stopped

@ -20,9 +20,9 @@
pre_tasks:
- name: Update apt cache
become: yes
become: true
apt:
update_cache: yes
update_cache: true
upgrade: dist
when: ansible_os_family == 'Debian'

@ -29,11 +29,11 @@
name: openstack.nodepool
- name: Install nodepool elements directory
become: yes
become: true
synchronize:
delete: yes
delete: true
dest: /etc/nodepool/
perms: yes
perms: true
rsync_opts:
- '--chown=nodepool:nodepool'
src: "{{ windmill_config_git_dest }}/nodepool/elements"

@ -24,7 +24,7 @@
- test_nodepool_pip_virtualenv_stat.stat.isdir
- name: Ensure gear is running
become: yes
become: true
shell: /usr/sbin/service gear status
changed_when: false
tags:

@ -24,13 +24,13 @@
- test_nodepool_pip_virtualenv_stat.stat.isdir
- name: Validate /etc/nodepool/nodepool.yaml
become: yes
become: true
become_user: nodepool
command: /opt/venv/nodepool/bin/nodepool -c /etc/nodepool/nodepool.yaml config-validate
changed_when: false
- name: Ensure nodepool-builder is running
become: yes
become: true
shell: /usr/sbin/service nodepool-builder status
changed_when: false
tags:

@ -24,13 +24,13 @@
- test_nodepool_pip_virtualenv_stat.stat.isdir
- name: Validate /etc/nodepool/nodepool.yaml
become: yes
become: true
become_user: nodepool
command: /opt/venv/nodepool/bin/nodepool -c /etc/nodepool/nodepool.yaml config-validate
changed_when: false
- name: Ensure nodepool-launcher is running
become: yes
become: true
shell: /usr/sbin/service nodepool-launcher status
changed_when: false
tags:

@ -13,7 +13,7 @@
# under the License.
---
- name: Create required directories.
become: yes
become: true
file:
group: root
owner: root
@ -21,7 +21,7 @@
state: directory
- name: Install dib-image-list.sh wrapper.
become: yes
become: true
copy:
dest: /opt/windmill/test.prove
group: root
@ -30,7 +30,7 @@
src: test_dib_image_list.sh
- name: Ensure ubuntu-bionic DIB image is built.
become: yes
become: true
become_user: nodepool
delay: 10
register: task_result

@ -13,7 +13,7 @@
# under the License.
---
- name: Ensure statsd is running
become: yes
become: true
shell: /usr/sbin/service statsd status
changed_when: false
tags:

@ -13,7 +13,7 @@
# under the License.
---
- name: Ensure zookeeper is running
become: yes
become: true
shell: /usr/sbin/service zookeeper status
changed_when: false
tags:

@ -24,7 +24,7 @@
- test_zuul_pip_virtualenv_stat.stat.isdir
- name: Ensure zuul-executor is running
become: yes
become: true
shell: /usr/sbin/service zuul-executor status
changed_when: false
tags:

@ -24,7 +24,7 @@
- test_zuul_pip_virtualenv_stat.stat.isdir
- name: Ensure zuul-fingergw is running
become: yes
become: true
shell: /usr/sbin/service zuul-fingergw status
changed_when: false
tags:

@ -24,7 +24,7 @@
- test_zuul_pip_virtualenv_stat.stat.isdir
- name: Ensure zuul-merger is running
become: yes
become: true
shell: /usr/sbin/service zuul-merger status
changed_when: false
tags:

@ -24,7 +24,7 @@
- test_zuul_pip_virtualenv_stat.stat.isdir
- name: Ensure zuul-scheduler is running
become: yes
become: true
shell: /usr/sbin/service zuul-scheduler status
changed_when: false
tags:

@ -24,7 +24,7 @@
- test_zuul_pip_virtualenv_stat.stat.isdir
- name: Ensure zuul-web is running
become: yes
become: true
shell: /usr/sbin/service zuul-web status
changed_when: false
tags:

@ -23,7 +23,7 @@
# TODO(pabelanger): I'm thinking we should likely create
# ansible-role-bubblewrap to allow user to better manage this dependency.
- name: Ensure bubblewrap is installed
become: yes
become: true
package:
name: bubblewrap
state: installed

@ -3,3 +3,4 @@ ansible-lint
ara
bashate
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
yamllint

@ -1,3 +1,4 @@
---
- hosts: all,!bastion
tasks:
- name: Ensure journald logs directory exists
@ -15,7 +16,7 @@
- statsd
- name: Collect statsd log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -38,7 +39,7 @@
- gear
- name: Collect gear log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -61,7 +62,7 @@
- nodepool-builder
- name: Collect nodepool-builder log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -87,7 +88,7 @@
- nodepool-launcher
- name: Collect nodepool-launcher log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -112,7 +113,7 @@
- zuul-scheduler
- name: Collect zuul-scheduler log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -138,7 +139,7 @@
- zuul-executor
- name: Collect zuul-executor log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -163,7 +164,7 @@
- zuul-fingergw
- name: Collect zuul-fingergw log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -188,7 +189,7 @@
- zuul-merger
- name: Collect zuul-merger log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:
@ -213,7 +214,7 @@
- zuul-web
- name: Collect zuul-web log files
become: yes
become: true
synchronize:
dest: "{{ zuul_output_dir }}/logs/logs/{{ inventory_hostname }}"
rsync_opts:

@ -1,3 +1,4 @@
---
# NOTE(pabelanger): Because we want to test Depends-On patches in the
# gate, we don't want our roles to update git after we pushed the repos
# from zuul-executors.

@ -1,3 +1,4 @@
---
# NOTE(pabelanger): In the gate, we want to create a zuul-test user /
# group as zuul already exists on our images.
zuul_user_name: zuul-test

@ -1,3 +1,4 @@
---
- hosts: all
tasks:
- name: Ensure ara-report directory exists

@ -1,3 +1,4 @@
---
- hosts: all
tasks:
# TODO(pabelanger): Remove once this lands in our base job in

@ -1,3 +1,4 @@
---
- hosts: all
tasks:
- name: Collect tox logs

@ -1,3 +1,4 @@
---
- hosts: all
tasks:
# TODO(pabelanger): Remove once this lands in our base job in
@ -7,7 +8,7 @@
name: ensure-output-dirs
- name: Disable extra wheels mirror
become: yes
become: true
lineinfile:
dest: /etc/pip.conf
regexp: ^extra-index-url
@ -26,7 +27,7 @@
- name: Install ansible configuration file
copy:
dest: "{{ ansible_user_dir }}/.ansible.cfg"
remote_src: True
remote_src: true
src: "{{ ansible_user_dir }}/{{ windmill_src_dir }}/tests/ansible.cfg"
- name: Install ansible roles via galaxy

@ -1,3 +1,4 @@
---
- hosts: all
tasks:
- name: Bootstrap bastion node using ansible

@ -1,3 +1,4 @@
---
- hosts: all
roles:
- tox

@ -1,3 +1,4 @@
---
- name: openstack.diskimage-builder
src: git+https://git.openstack.org/openstack/ansible-role-diskimage-builder

@ -25,6 +25,7 @@ commands = python setup.py build_sphinx
basepython = python3
whitelist_externals = bash
commands =
yamllint -s .
flake8
bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint"

Loading…
Cancel
Save