Auto-fix yaml rules

In order to reduce divergance with ansible-lint rules, we apply
auto-fixing of violations.

In current patch we replace all kind of truthy variables with
`true` or `false` values to align with recommendations along with
alignment of used quotes.

Change-Id: Id65c3c3a2a36c28fc9fb9a90b151570e9fa694bd
This commit is contained in:
Dmitriy Rabotyagov
2025-02-12 15:11:20 +01:00
parent 6b9c22c380
commit 64321b6fa5
14 changed files with 37 additions and 38 deletions

1
.gitignore vendored
View File

@@ -45,6 +45,7 @@ logs/*
# OS generated files # # OS generated files #
###################### ######################
._* ._*
.ansible
.tox .tox
*.egg-info *.egg-info
.eggs .eggs

View File

@@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
## Verbosity Options ## Verbosity Options
debug: False debug: false
stestr_executable: "{{ _stestr_executable | default('stestr') }}" stestr_executable: "{{ _stestr_executable | default('stestr') }}"
@@ -40,9 +40,9 @@ tempest_service_setup_host_python_interpreter: >-
}} }}
# Toggle whether tempest actually executes # Toggle whether tempest actually executes
tempest_run: no tempest_run: false
# Toggle whether tempest cleanup executes prior and after regular tempest run # Toggle whether tempest cleanup executes prior and after regular tempest run
tempest_cleanup: no tempest_cleanup: false
# 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
@@ -58,7 +58,7 @@ tempest_fixed_network_name: public
# Tempest Resources # Tempest Resources
# Toggle whether default resources are implemented # Toggle whether default resources are implemented
tempest_default_role_resources: yes tempest_default_role_resources: true
tempest_public_net_create: true tempest_public_net_create: true
tempest_private_net_create: false tempest_private_net_create: false
tempest_router_create: false tempest_router_create: false
@@ -172,8 +172,8 @@ tempest_includelist_file_path: "{{ tempest_workspace }}/etc/tempest_includelist.
tempest_excludelist_file_path: "{{ tempest_workspace }}/etc/tempest_excludelist.txt" tempest_excludelist_file_path: "{{ tempest_workspace }}/etc/tempest_excludelist.txt"
# Variable prefixes that will be dynamically gathered to create the include/exclude list # Variable prefixes that will be dynamically gathered to create the include/exclude list
tempest_test_search_includelist_pattern: 'tempest_test_includelist_' tempest_test_search_includelist_pattern: "tempest_test_includelist_"
tempest_test_search_excludelist_pattern: 'tempest_test_excludelist_' tempest_test_search_excludelist_pattern: "tempest_test_excludelist_"
# Tests to execute: # Tests to execute:
# This sets up a list of tests to execute based on what's deployed in the environment. # This sets up a list of tests to execute based on what's deployed in the environment.
@@ -220,15 +220,15 @@ tempest_public_subnet_cidr: "10.1.13.0/24"
# tempest_public_subnet_gateway_ip: # tempest_public_subnet_gateway_ip:
tempest_public_net_provider_type: "flat" tempest_public_net_provider_type: "flat"
tempest_public_net_physical_name: "physnet1" tempest_public_net_physical_name: "physnet1"
tempest_public_net_shared: False tempest_public_net_shared: false
# tempest_public_net_seg_id: # tempest_public_net_seg_id:
tempest_public_router_external: "True" tempest_public_router_external: "True"
# Example allocation range: # Example allocation range:
# tempest_public_subnet_allocation_pools: "10.1.13.150-10.1.13.200" # tempest_public_subnet_allocation_pools: "10.1.13.150-10.1.13.200"
tempest_compute_image_ssh_user: cirros tempest_compute_image_ssh_user: cirros
tempest_compute_run_ssh: True tempest_compute_run_ssh: true
tempest_network_ping_gateway: False tempest_network_ping_gateway: false
tempest_dashboard_url: "https://{{ external_lb_vip_address | default('127.0.0.1') }}/" tempest_dashboard_url: "https://{{ external_lb_vip_address | default('127.0.0.1') }}/"
@@ -263,7 +263,7 @@ tempest_service_available_neutron_bgpvpn: >-
tempest_service_available_neutron_vpnaas: >- 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 ('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_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 }}"
@@ -274,8 +274,8 @@ tempest_service_available_swift: >-
(ceph_rgws is defined and ceph_rgws | length > 0) (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
tempest_service_available_zaqar: "{{ groups['zaqar_all'] is defined and groups['zaqar_all'] | length > 0 }}" tempest_service_available_zaqar: "{{ groups['zaqar_all'] is defined and groups['zaqar_all'] | length > 0 }}"
tempest_service_available_zun: "{{ groups['zun_all'] is defined and groups['zun_all'] | length > 0 }}" tempest_service_available_zun: "{{ groups['zun_all'] is defined and groups['zun_all'] | length > 0 }}"
@@ -342,7 +342,7 @@ tempest_projects:
- "tempest" - "tempest"
## Tunable overrides ## Tunable overrides
tempest_tempest_conf_search_overrides_pattern: 'tempest_tempest_conf_overrides' tempest_tempest_conf_search_overrides_pattern: "tempest_tempest_conf_overrides"
tempest_tempest_conf_overrides: {} tempest_tempest_conf_overrides: {}
## The name of cloud from clouds.yaml ## The name of cloud from clouds.yaml

View File

@@ -1,10 +1,8 @@
--- ---
- name: Converge - name: Converge
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: this does nothing - name: this does nothing
debug: debug:
msg: foo msg: foo

View File

@@ -1,3 +1,4 @@
---
# python_venv_build ansible role # python_venv_build ansible role
- name: python_venv_build - name: python_venv_build
scm: git scm: git

View File

@@ -34,7 +34,7 @@
with_items: "{{ tempest_services }}" with_items: "{{ tempest_services }}"
when: tempest_services | length > 0 when: tempest_services | length > 0
# NOTE(jrosser) we use source installs for temepest and it's plugins on ubuntu distro installs # NOTE(jrosser) we use source installs for temepest and it's plugins on ubuntu distro installs
- name: Gather variables for source installs - name: Gather variables for source installs
include_vars: source_install.yml include_vars: source_install.yml
when: when:
@@ -57,7 +57,7 @@
- name: Importing tempest_resources tasks - name: Importing tempest_resources tasks
import_tasks: tempest_resources.yml import_tasks: tempest_resources.yml
when: tempest_default_role_resources | bool when: tempest_default_role_resources | bool
run_once: yes run_once: true
tags: tags:
- tempest-config - tempest-config
- tempest-run - tempest-run

View File

@@ -25,7 +25,6 @@
retries: 5 retries: 5
delay: 2 delay: 2
# NOTE(noonedeadpunk): # NOTE(noonedeadpunk):
# Applying default filter is required despite the variable being defined # Applying default filter is required despite the variable being defined
# in defaults as in case of non-integrated tests meta handlers from other roles might fail. # in defaults as in case of non-integrated tests meta handlers from other roles might fail.
@@ -40,5 +39,5 @@
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: false
when: tempest_run_stackviz | bool when: tempest_run_stackviz | bool

View File

@@ -28,7 +28,7 @@
- name: Retrieve the constraints URL - name: Retrieve the constraints URL
uri: uri:
url: "{{ tempest_upper_constraints_url }}" url: "{{ tempest_upper_constraints_url }}"
return_content: yes return_content: true
register: _u_c_contents register: _u_c_contents
- name: Install the python venv - name: Install the python venv

View File

@@ -205,9 +205,9 @@
cloud: "{{ tempest_cloud_name }}" cloud: "{{ tempest_cloud_name }}"
interface: "{{ tempest_interface_name }}" interface: "{{ tempest_interface_name }}"
filters: filters:
'name': "{{ image['name'] }}" "name": "{{ image['name'] }}"
'tags': "tags":
- 'managed_by_tempest' - "managed_by_tempest"
loop: "{{ tempest_images }}" loop: "{{ tempest_images }}"
loop_control: loop_control:
loop_var: image loop_var: image

View File

@@ -47,5 +47,5 @@
copy: copy:
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: true
mode: "0644" mode: "0644"

View File

@@ -20,12 +20,12 @@ _stestr_executable: "{{ (tempest_install_method == 'distro') | ternary('testr',
tempest_distro_packages: tempest_distro_packages:
- git - git
- libxslt1.1 # required by the python module unittest2 - libxslt1.1 # required by the python module unittest2
- build-essential # required to build tempest plugins (TODO) remove this when repo server can satisfy the tempest plugin requirements - build-essential # required to build tempest plugins (TODO) remove this when repo server can satisfy the tempest plugin requirements
- nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests - nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests
tempest_devel_distro_packages: tempest_devel_distro_packages:
- python3-dev # required for netifaces module for stackviz - python3-dev # required for netifaces module for stackviz
tempest_service_distro_packages: tempest_service_distro_packages:
- tempest - tempest

View File

@@ -98,7 +98,7 @@ _tempest_plugins:
- name: keystone-tempest-plugin - name: keystone-tempest-plugin
repo: "{{ tempest_plugin_keystone_git_repo }}" repo: "{{ tempest_plugin_keystone_git_repo }}"
branch: "{{ tempest_plugin_keystone_git_install_branch }}" branch: "{{ tempest_plugin_keystone_git_install_branch }}"
install: yes install: true
- name: magnum-tempest-plugin - name: magnum-tempest-plugin
repo: "{{ tempest_plugin_magnum_git_repo }}" repo: "{{ tempest_plugin_magnum_git_repo }}"
branch: "{{ tempest_plugin_magnum_git_install_branch }}" branch: "{{ tempest_plugin_magnum_git_install_branch }}"

View File

@@ -15,10 +15,10 @@
tempest_distro_packages: tempest_distro_packages:
- git - git
- libxslt # required by the python module unittest2 - libxslt # required by the python module unittest2
- gcc # required to build tempest plugins (TODO) remove this when the repo server can satisfy the tempest plugin requirements - gcc # required to build tempest plugins (TODO) remove this when the repo server can satisfy the tempest plugin requirements
- iputils - iputils
- nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests - nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests
_stestr_executable: stestr-3 _stestr_executable: stestr-3
@@ -34,7 +34,7 @@ tempest_service_distro_packages:
- subunit-filters - subunit-filters
tempest_devel_distro_packages: tempest_devel_distro_packages:
- python3-devel # required for netifaces module for stackviz - python3-devel # required for netifaces module for stackviz
tempest_plugin_distro_packages: tempest_plugin_distro_packages:
- "{{ (tempest_service_available_aodh | bool) | ternary('python3-telemetry-tests-tempest', '') }}" - "{{ (tempest_service_available_aodh | bool) | ternary('python3-telemetry-tests-tempest', '') }}"

View File

@@ -15,10 +15,10 @@
tempest_distro_packages: tempest_distro_packages:
- git - git
- libxslt # required by the python module unittest2 - libxslt # required by the python module unittest2
- gcc # required to build tempest plugins (TODO) remove this when the repo server can satisfy the tempest plugin requirements - gcc # required to build tempest plugins (TODO) remove this when the repo server can satisfy the tempest plugin requirements
- iputils - iputils
- nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests - nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests
_stestr_executable: stestr-3 _stestr_executable: stestr-3
@@ -34,7 +34,7 @@ tempest_service_distro_packages:
- subunit-filters - subunit-filters
tempest_devel_distro_packages: tempest_devel_distro_packages:
- python3-devel # required for netifaces module for stackviz - python3-devel # required for netifaces module for stackviz
tempest_plugin_distro_packages: tempest_plugin_distro_packages:
- "{{ (tempest_service_available_aodh | bool) | ternary('python3-telemetry-tests-tempest', '') }}" - "{{ (tempest_service_available_aodh | bool) | ternary('python3-telemetry-tests-tempest', '') }}"

View File

@@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
- hosts: all[0] - hosts: all[0]
become: yes become: true
tasks: tasks:
- name: Configure the tempestconf settings - name: Configure the tempestconf settings
copy: copy: