Fix linters and metadata

With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.

With that we also update metdata to reflect current state.

Change-Id: Ifcb6ebfa971e324e447509e50cc7294bddd6a4a0
This commit is contained in:
Dmitriy Rabotyagov 2023-07-14 20:37:15 +02:00
parent 6081d1daac
commit 687dcb30bf
12 changed files with 247 additions and 212 deletions

View File

@ -33,7 +33,11 @@ tempest_package_state: "latest"
# for the service setup. The host must already have # for the service setup. The host must already have
# clouds.yaml properly configured. # clouds.yaml properly configured.
tempest_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" tempest_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
tempest_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((tempest_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" tempest_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(tempest_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
# Toggle whether tempest actually executes # Toggle whether tempest actually executes
tempest_run: no tempest_run: no
@ -41,7 +45,7 @@ tempest_run: no
tempest_cleanup: no tempest_cleanup: no
# if tempest_cleanup_dry_run is set to true, tempest cleanup will log all found # if tempest_cleanup_dry_run is set to true, tempest cleanup will log all found
# leftover resources to a dry_run.json file, none resources will be deleted # leftover resources to a dry_run.json file, none resources will be deleted
#tempest_cleanup_dry_run: no # tempest_cleanup_dry_run: no
# Credential Provider Mechanisms # Credential Provider Mechanisms
# If tempest_test_accounts is not an empty string, then use_dynamic_credentials will be turned off # If tempest_test_accounts is not an empty string, then use_dynamic_credentials will be turned off
@ -63,7 +67,7 @@ tempest_flavors_create: true
tempest_projects_create: "{{ tempest_public_net_create or tempest_private_net_create or tempest_router_create }}" tempest_projects_create: "{{ tempest_public_net_create or tempest_private_net_create or tempest_router_create }}"
# Define 0 (serial) or more to use a non default concurrency # Define 0 (serial) or more to use a non default concurrency
#tempest_run_concurrency: # tempest_run_concurrency:
# Define the worker file to be used by tempest # Define the worker file to be used by tempest
# This worker file is parsed to stestr to manually schedule tempest tests # This worker file is parsed to stestr to manually schedule tempest tests
@ -71,9 +75,10 @@ tempest_projects_create: "{{ tempest_public_net_create or tempest_private_net_cr
# We comment `tempest_git_repo` so that we do not attempt to build the wheel from this repo/branch. # We comment `tempest_git_repo` so that we do not attempt to build the wheel from this repo/branch.
# Instead, we want tempest to get built from the stable release defined in global requirements. # Instead, we want tempest to get built from the stable release defined in global requirements.
#tempest_git_repo: https://opendev.org/openstack/tempest # tempest_git_repo: https://opendev.org/openstack/tempest
tempest_git_install_branch: master tempest_git_install_branch: master
tempest_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" tempest_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
tempest_git_constraints: tempest_git_constraints:
- "--constraint {{ tempest_upper_constraints_url }}" - "--constraint {{ tempest_upper_constraints_url }}"
@ -258,15 +263,22 @@ tempest_service_available_manila: "{{ groups['manila_all'] is defined and groups
tempest_service_available_mistral: "{{ groups['mistral_all'] is defined and groups['mistral_all'] | length > 0 }}" tempest_service_available_mistral: "{{ groups['mistral_all'] is defined and groups['mistral_all'] | length > 0 }}"
tempest_service_available_murano: "{{ groups['murano_all'] is defined and groups['murano_all'] | length > 0 }}" tempest_service_available_murano: "{{ groups['murano_all'] is defined and groups['murano_all'] | length > 0 }}"
tempest_service_available_neutron: "{{ groups['neutron_all'] is defined and groups['neutron_all'] | length > 0 }}" tempest_service_available_neutron: "{{ groups['neutron_all'] is defined and groups['neutron_all'] | length > 0 }}"
tempest_service_available_neutron_bgpvpn: "{{ (groups['neutron_all'] is defined) and (groups['neutron_all'] | length > 0) and ('bgpvpn' in neutron_plugin_base | default([])) }}" tempest_service_available_neutron_bgpvpn: >-
tempest_service_available_neutron_vpnaas: "{{ (groups['neutron_all'] is defined) and (groups['neutron_all'] | length > 0) and ('vpnaas' in neutron_plugin_base | default([])) }}" {{ (groups['neutron_all'] is defined) and (groups['neutron_all'] | length > 0) and ('bgpvpn' in neutron_plugin_base | default([])) }}
tempest_service_available_neutron_vpnaas: >-
{{ (groups['neutron_all'] is defined) and (groups['neutron_all'] | length > 0) and ('vpnaas' in neutron_plugin_base | default([])) }}
tempest_service_available_nova: "{{ groups['nova_all'] is defined and groups['nova_all'] | length > 0 }}" tempest_service_available_nova: "{{ groups['nova_all'] is defined and groups['nova_all'] | length > 0 }}"
tempest_service_available_novajoin: False tempest_service_available_novajoin: False
tempest_service_available_octavia: "{{ groups['octavia_all'] is defined and groups['octavia_all'] | length > 0 }}" tempest_service_available_octavia: "{{ groups['octavia_all'] is defined and groups['octavia_all'] | length > 0 }}"
tempest_service_available_panko: "{{ groups['panko_all'] is defined and groups['panko_all'] | length > 0 }}" tempest_service_available_panko: "{{ groups['panko_all'] is defined and groups['panko_all'] | length > 0 }}"
tempest_service_available_sahara: "{{ groups['sahara_all'] is defined and groups['sahara_all'] | length > 0 }}" tempest_service_available_sahara: "{{ groups['sahara_all'] is defined and groups['sahara_all'] | length > 0 }}"
tempest_service_available_senlin: "{{ groups['senlin_all'] is defined and groups['senlin_all'] | length > 0 }}" tempest_service_available_senlin: "{{ groups['senlin_all'] is defined and groups['senlin_all'] | length > 0 }}"
tempest_service_available_swift: "{{ (groups['swift_all'] is defined and groups['swift_all'] | length > 0) or (groups['ceph-rgw'] is defined and groups['ceph-rgw'] | length > 0) or (ceph_rgws is defined and ceph_rgws | length > 0) }}" tempest_service_available_swift: >-
{{
(groups['swift_all'] is defined and groups['swift_all'] | length > 0) or
(groups['ceph-rgw'] is defined and groups['ceph-rgw'] | length > 0) or
(ceph_rgws is defined and ceph_rgws | length > 0)
}}
tempest_service_available_trove: "{{ groups['trove_all'] is defined and groups['trove_all'] | length > 0 }}" tempest_service_available_trove: "{{ groups['trove_all'] is defined and groups['trove_all'] | length > 0 }}"
tempest_service_available_whitebox: False tempest_service_available_whitebox: False
tempest_service_available_whitebox_neutron: False tempest_service_available_whitebox_neutron: False
@ -277,7 +289,11 @@ tempest_service_available_zun: "{{ groups['zun_all'] is defined and groups['zun_
tempest_keystone_interface_insecure: "{{ (keystone_service_internaluri_insecure | default(false)) | bool }}" tempest_keystone_interface_insecure: "{{ (keystone_service_internaluri_insecure | default(false)) | bool }}"
tempest_pip_packages: tempest_pip_packages:
- "{{ (tempest_git_repo is defined) | ternary('git+' ~ (tempest_git_repo | default('https://opendev.org/openstack/tempest.git')) ~ '@' ~ tempest_git_install_branch ~ '#egg=tempest', 'tempest') }}" - "{{
(tempest_git_repo is defined) | ternary(
'git+' ~ (tempest_git_repo | default('https://opendev.org/openstack/tempest.git')) ~ '@' ~ tempest_git_install_branch ~ '#egg=tempest',
'tempest')
}}"
- cmd2 - cmd2
- ddt - ddt
- junitxml - junitxml
@ -362,7 +378,13 @@ tempest_tempestconf_git_install_branch: master
tempest_tempestconf_git_constraints: tempest_tempestconf_git_constraints:
- "--constraint {{ tempest_upper_constraints_url }}" - "--constraint {{ tempest_upper_constraints_url }}"
tempest_tempestconf_pip_packages: tempest_tempestconf_pip_packages:
- "{{ (tempest_tempestconf_git_repo is defined) | ternary('git+' ~ (tempest_tempestconf_git_repo | default('https://opendev.org/openinfra/python-tempestconf')) ~ '@' ~ tempest_tempestconf_git_install_branch ~ '#egg=python_tempestconf', 'python_tempestconf') }}" - "{{
(tempest_tempestconf_git_repo is defined) | ternary(
'git+' ~ (tempest_tempestconf_git_repo | default(
'https://opendev.org/openinfra/python-tempestconf')
) ~ '@' ~ tempest_tempestconf_git_install_branch ~ '#egg=python_tempestconf',
'python_tempestconf')
}}"
tempest_tempestconf_profile: tempest_tempestconf_profile:
debug: true debug: true
create: true create: true

View File

@ -15,25 +15,23 @@
galaxy_info: galaxy_info:
role_name: os_tempest role_name: os_tempest
namespace: openstack
author: rcbops author: rcbops
description: Installation and setup of tempest description: Installation and setup of tempest
company: Rackspace company: Rackspace
license: Apache2 license: Apache2
min_ansible_version: 2.10 min_ansible_version: "2.10"
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- buster - bullseye
- name: Ubuntu - name: Ubuntu
versions: versions:
- bionic
- focal - focal
- jammy
- name: EL - name: EL
versions: versions:
- 8 - "9"
- name: CentOS
versions:
- 8
galaxy_tags: galaxy_tags:
- cloud - cloud
- python - python

View File

@ -30,7 +30,7 @@
- name: Set tempest service specific variables - name: Set tempest service specific variables
set_fact: set_fact:
tempest_service_available_{{ item }}: true tempest_service_available_{{ item }}: true # noqa: var-naming[no-jinja]
with_items: "{{ tempest_services }}" with_items: "{{ tempest_services }}"
when: tempest_services | length > 0 when: tempest_services | length > 0
@ -49,32 +49,38 @@
tags: tags:
- always - always
- import_tasks: tempest_install.yml - name: Importing tempest_install tasks
import_tasks: tempest_install.yml
tags: tags:
- tempest-install - tempest-install
- import_tasks: tempest_resources.yml - name: Importing tempest_resources tasks
import_tasks: tempest_resources.yml
when: tempest_default_role_resources | bool when: tempest_default_role_resources | bool
run_once: yes run_once: yes
tags: tags:
- tempest-config - tempest-config
- tempest-run - tempest-run
- import_tasks: tempest_post_install.yml - name: Importing tempest_post_install tasks
import_tasks: tempest_post_install.yml
tags: tags:
- tempest-config - tempest-config
- name: Flush handlers - name: Flush handlers
meta: flush_handlers meta: flush_handlers
- import_tasks: tempest_cleanup_init.yml - name: Importing tempest_cleanup_init tasks
import_tasks: tempest_cleanup_init.yml
when: tempest_cleanup | bool when: tempest_cleanup | bool
- import_tasks: tempest_run.yml - name: Importing tempest_run tasks
import_tasks: tempest_run.yml
when: tempest_run | bool when: tempest_run | bool
tags: tags:
- tempest-config - tempest-config
- tempest-run - tempest-run
- import_tasks: tempest_cleanup.yml - name: Importing tempest_cleanup tasks
import_tasks: tempest_cleanup.yml
when: tempest_cleanup | bool when: tempest_cleanup | bool

View File

@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- block: - name: Cleanup leftover resources
- name: Cleanup leftover resources
shell: > shell: >
set -e; set -e;
if [ -d {{ tempest_venv_bin }} ]; if [ -d {{ tempest_venv_bin }} ];
@ -28,6 +27,7 @@
{% if debug | bool %} {% if debug | bool %}
--debug --debug
{% endif %} {% endif %}
changed_when: false
args: args:
chdir: "{{ tempest_workspace }}" chdir: "{{ tempest_workspace }}"
executable: /bin/bash executable: /bin/bash

View File

@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- block: - name: Generate saved_state.json for tempest cleanup
- name: Generate saved_state.json for tempest cleanup
shell: | shell: |
set -e set -e
if [ -d {{ tempest_venv_bin }} ]; if [ -d {{ tempest_venv_bin }} ];
@ -26,6 +25,7 @@
--debug \ --debug \
{% endif %} {% endif %}
--init-saved-state --init-saved-state
changed_when: false
args: args:
chdir: "{{ tempest_workspace }}" chdir: "{{ tempest_workspace }}"
executable: /bin/bash executable: /bin/bash

View File

@ -39,6 +39,6 @@
vars: vars:
venv_install_destination_path: "{{ stackviz_venv_bin | dirname }}" venv_install_destination_path: "{{ stackviz_venv_bin | dirname }}"
venv_pip_install_args: "{{ stackviz_pip_install_args }}" venv_pip_install_args: "{{ stackviz_pip_install_args }}"
venv_pip_packages: "{{ [ stackviz_tarball ] }}" venv_pip_packages: "{{ [stackviz_tarball] }}"
venv_wheel_build_enable: no venv_wheel_build_enable: no
when: tempest_run_stackviz | bool when: tempest_run_stackviz | bool

View File

@ -36,7 +36,8 @@
name: "python_venv_build" name: "python_venv_build"
vars: vars:
venv_python_executable: "{{ tempest_venv_python_executable }}" venv_python_executable: "{{ tempest_venv_python_executable }}"
venv_build_constraints: "{{ (tempest_git_repo is defined) | ternary( _u_c_contents.content.split('\n') | reject('match', '^tempest=') | list, tempest_git_constraints) }}" venv_build_constraints: >-
{{ (tempest_git_repo is defined) | ternary(_u_c_contents.content.split('\n') | reject('match', '^tempest=') | list, tempest_git_constraints) }}
venv_install_destination_path: "{{ tempest_venv_bin | dirname }}" venv_install_destination_path: "{{ tempest_venv_bin | dirname }}"
venv_build_distro_package_list: "{{ tempest_devel_distro_packages }}" venv_build_distro_package_list: "{{ tempest_devel_distro_packages }}"
venv_pip_install_args: "{{ tempest_pip_install_args }}" venv_pip_install_args: "{{ tempest_pip_install_args }}"

View File

@ -20,7 +20,7 @@
state: directory state: directory
owner: "{{ item.owner | default(omit) }}" owner: "{{ item.owner | default(omit) }}"
group: "{{ item.group | default(omit) }}" group: "{{ item.group | default(omit) }}"
mode: "{{ item.mode|default('0755') }}" mode: "{{ item.mode | default('0755') }}"
with_items: with_items:
- path: "{{ tempest_log_dir | realpath }}" - path: "{{ tempest_log_dir | realpath }}"
owner: root owner: root
@ -122,7 +122,8 @@
# don't trigger ANSIBLE0013 # don't trigger ANSIBLE0013
- skip_ansible_lint - skip_ansible_lint
- import_tasks: tempestconf.yml - name: Importing tempestconf tasks
import_tasks: tempestconf.yml
when: tempest_use_tempestconf | bool when: tempest_use_tempestconf | bool
tags: tags:
- tempest-config - tempest-config
@ -135,6 +136,7 @@
. {{ tempest_venv_bin }}/activate . {{ tempest_venv_bin }}/activate
fi fi
tempest list-plugins tempest list-plugins
changed_when: false
args: args:
executable: /bin/bash executable: /bin/bash
when: "debug | bool" when: "debug | bool"

View File

@ -95,6 +95,7 @@
file: file:
path: "{{ tempest_image_dir }}" path: "{{ tempest_image_dir }}"
state: directory state: directory
mode: "0755"
when: when:
- tempest_service_available_glance | bool - tempest_service_available_glance | bool
- tempest_images_create | bool - tempest_images_create | bool
@ -174,7 +175,7 @@
- name: Store demo tenant id - name: Store demo tenant id
set_fact: set_fact:
keystone_demo_tenant_id: "{{ (add_project.results | json_query('[*].project.id'))[0] }}" keystone_demo_tenant_id: "{{ (add_project.results | json_query('[*].project.id'))[0] }}" # noqa: jinja[invalid]
when: when:
- tempest_projects_create | bool - tempest_projects_create | bool
@ -320,6 +321,7 @@
set -e set -e
ping -c2 "{{ router_ip }}" ping -c2 "{{ router_ip }}"
register: _ping_router register: _ping_router
changed_when: false
until: _ping_router is success until: _ping_router is success
retries: 5 retries: 5
delay: 10 delay: 10

View File

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- block: - name: Executing tempest and collect results
block:
- name: Execute tempest tests - name: Execute tempest tests
shell: | shell: |
set -e set -e

View File

@ -48,3 +48,4 @@
src: "{{ tempest_workspace }}/etc/tempest.conf" src: "{{ tempest_workspace }}/etc/tempest.conf"
dest: "/etc/tempest/tempest.conf" dest: "/etc/tempest/tempest.conf"
remote_src: yes remote_src: yes
mode: "0644"

View File

@ -34,14 +34,10 @@ tempest_images_map:
checksum: "sha256:db9420c481c11dee17860aa46fb1a3efa05fa4fb152726d6344e24da03cb0ccf" checksum: "sha256:db9420c481c11dee17860aa46fb1a3efa05fa4fb152726d6344e24da03cb0ccf"
format: "qcow2" format: "qcow2"
name: "cirros" name: "cirros"
# properties:
#hw_firmware_type: uefi
- url: "https://download.cirros-cloud.net/0.6.1/cirros-0.6.1-aarch64-disk.img" - url: "https://download.cirros-cloud.net/0.6.1/cirros-0.6.1-aarch64-disk.img"
checksum: "sha256:db9420c481c11dee17860aa46fb1a3efa05fa4fb152726d6344e24da03cb0ccf" checksum: "sha256:db9420c481c11dee17860aa46fb1a3efa05fa4fb152726d6344e24da03cb0ccf"
format: "qcow2" format: "qcow2"
name: "cirros" name: "cirros"
#properties:
#hw_firmware_type: uefi
# Each tempest plugin could take the following arguments: # Each tempest plugin could take the following arguments:
# - name: # - name:
@ -118,7 +114,13 @@ _tempest_plugins:
- name: telemetry-tempest-plugin - name: telemetry-tempest-plugin
repo: "{{ tempest_plugin_telemetry_git_repo }}" repo: "{{ tempest_plugin_telemetry_git_repo }}"
branch: "{{ tempest_plugin_telemetry_git_install_branch }}" branch: "{{ tempest_plugin_telemetry_git_install_branch }}"
install: "{{ (tempest_service_available_aodh | bool) or (tempest_service_available_ceilometer | bool) or (tempest_service_available_gnocchi | bool) or (tempest_service_available_panko | bool) }}" install: >-
{{
(tempest_service_available_aodh | bool) or
(tempest_service_available_ceilometer | bool) or
(tempest_service_available_gnocchi | bool) or
(tempest_service_available_panko | bool)
}}
- name: trove-tempest-plugin - name: trove-tempest-plugin
repo: "{{ tempest_plugin_trove_git_repo }}" repo: "{{ tempest_plugin_trove_git_repo }}"
branch: "{{ tempest_plugin_trove_git_install_branch }}" branch: "{{ tempest_plugin_trove_git_install_branch }}"