From 64321b6fa554d0b3d151f46232e5124a0956de26 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 12 Feb 2025 15:11:20 +0100 Subject: [PATCH] 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 --- .gitignore | 1 + defaults/main.yml | 26 +++++++++++++------------- molecule/default/converge.yml | 2 -- requirements.yml | 1 + tasks/main.yml | 4 ++-- tasks/tempest_install.yml | 3 +-- tasks/tempest_install_source.yml | 2 +- tasks/tempest_resources.yml | 6 +++--- tasks/tempestconf.yml | 2 +- vars/debian.yml | 8 ++++---- vars/main.yml | 2 +- vars/redhat-8.yml | 8 ++++---- vars/redhat-9.yml | 8 ++++---- zuul.d/playbooks/pre-tempestconf.yml | 2 +- 14 files changed, 37 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 3a772066..c46a9ec6 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ logs/* # OS generated files # ###################### ._* +.ansible .tox *.egg-info .eggs diff --git a/defaults/main.yml b/defaults/main.yml index 86170531..9fd9febd 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,7 +14,7 @@ # limitations under the License. ## Verbosity Options -debug: False +debug: false stestr_executable: "{{ _stestr_executable | default('stestr') }}" @@ -40,9 +40,9 @@ tempest_service_setup_host_python_interpreter: >- }} # Toggle whether tempest actually executes -tempest_run: no +tempest_run: false # 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 # leftover resources to a dry_run.json file, none resources will be deleted # tempest_cleanup_dry_run: no @@ -58,7 +58,7 @@ tempest_fixed_network_name: public # Tempest Resources # Toggle whether default resources are implemented -tempest_default_role_resources: yes +tempest_default_role_resources: true tempest_public_net_create: true tempest_private_net_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" # Variable prefixes that will be dynamically gathered to create the include/exclude list -tempest_test_search_includelist_pattern: 'tempest_test_includelist_' -tempest_test_search_excludelist_pattern: 'tempest_test_excludelist_' +tempest_test_search_includelist_pattern: "tempest_test_includelist_" +tempest_test_search_excludelist_pattern: "tempest_test_excludelist_" # Tests to execute: # 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_net_provider_type: "flat" tempest_public_net_physical_name: "physnet1" -tempest_public_net_shared: False +tempest_public_net_shared: false # tempest_public_net_seg_id: tempest_public_router_external: "True" # Example allocation range: # tempest_public_subnet_allocation_pools: "10.1.13.150-10.1.13.200" tempest_compute_image_ssh_user: cirros -tempest_compute_run_ssh: True -tempest_network_ping_gateway: False +tempest_compute_run_ssh: true +tempest_network_ping_gateway: false 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: >- {{ (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_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_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 }}" @@ -274,8 +274,8 @@ tempest_service_available_swift: >- (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_whitebox: False -tempest_service_available_whitebox_neutron: False +tempest_service_available_whitebox: 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_zun: "{{ groups['zun_all'] is defined and groups['zun_all'] | length > 0 }}" @@ -342,7 +342,7 @@ tempest_projects: - "tempest" ## 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: {} ## The name of cloud from clouds.yaml diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 995cd808..5c1a13e8 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -1,10 +1,8 @@ --- - - name: Converge hosts: all gather_facts: false tasks: - - name: this does nothing debug: msg: foo diff --git a/requirements.yml b/requirements.yml index 12386896..bed68bf2 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,3 +1,4 @@ +--- # python_venv_build ansible role - name: python_venv_build scm: git diff --git a/tasks/main.yml b/tasks/main.yml index 4c694ad0..72be4686 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -34,7 +34,7 @@ with_items: "{{ tempest_services }}" 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 include_vars: source_install.yml when: @@ -57,7 +57,7 @@ - name: Importing tempest_resources tasks import_tasks: tempest_resources.yml when: tempest_default_role_resources | bool - run_once: yes + run_once: true tags: - tempest-config - tempest-run diff --git a/tasks/tempest_install.yml b/tasks/tempest_install.yml index cbd5dd16..b66797a0 100644 --- a/tasks/tempest_install.yml +++ b/tasks/tempest_install.yml @@ -25,7 +25,6 @@ retries: 5 delay: 2 - # NOTE(noonedeadpunk): # 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. @@ -40,5 +39,5 @@ venv_install_destination_path: "{{ stackviz_venv_bin | dirname }}" venv_pip_install_args: "{{ stackviz_pip_install_args }}" venv_pip_packages: "{{ [stackviz_tarball] }}" - venv_wheel_build_enable: no + venv_wheel_build_enable: false when: tempest_run_stackviz | bool diff --git a/tasks/tempest_install_source.yml b/tasks/tempest_install_source.yml index 89241e7f..f5879984 100644 --- a/tasks/tempest_install_source.yml +++ b/tasks/tempest_install_source.yml @@ -28,7 +28,7 @@ - name: Retrieve the constraints URL uri: url: "{{ tempest_upper_constraints_url }}" - return_content: yes + return_content: true register: _u_c_contents - name: Install the python venv diff --git a/tasks/tempest_resources.yml b/tasks/tempest_resources.yml index e7973070..264ec7ce 100644 --- a/tasks/tempest_resources.yml +++ b/tasks/tempest_resources.yml @@ -205,9 +205,9 @@ cloud: "{{ tempest_cloud_name }}" interface: "{{ tempest_interface_name }}" filters: - 'name': "{{ image['name'] }}" - 'tags': - - 'managed_by_tempest' + "name": "{{ image['name'] }}" + "tags": + - "managed_by_tempest" loop: "{{ tempest_images }}" loop_control: loop_var: image diff --git a/tasks/tempestconf.yml b/tasks/tempestconf.yml index 1d9b31f6..ca36ed59 100644 --- a/tasks/tempestconf.yml +++ b/tasks/tempestconf.yml @@ -47,5 +47,5 @@ copy: src: "{{ tempest_workspace }}/etc/tempest.conf" dest: "/etc/tempest/tempest.conf" - remote_src: yes + remote_src: true mode: "0644" diff --git a/vars/debian.yml b/vars/debian.yml index 58072f24..42b3381e 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -20,12 +20,12 @@ _stestr_executable: "{{ (tempest_install_method == 'distro') | ternary('testr', tempest_distro_packages: - git - - 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 - - nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests + - 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 + - nmap # provides ncat tool which is required by some of the neutron-tempest-plugin scenario tests 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 diff --git a/vars/main.yml b/vars/main.yml index bc2522b5..49d7f8b8 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -98,7 +98,7 @@ _tempest_plugins: - name: keystone-tempest-plugin repo: "{{ tempest_plugin_keystone_git_repo }}" branch: "{{ tempest_plugin_keystone_git_install_branch }}" - install: yes + install: true - name: magnum-tempest-plugin repo: "{{ tempest_plugin_magnum_git_repo }}" branch: "{{ tempest_plugin_magnum_git_install_branch }}" diff --git a/vars/redhat-8.yml b/vars/redhat-8.yml index 0a40aa49..d6d13ed6 100644 --- a/vars/redhat-8.yml +++ b/vars/redhat-8.yml @@ -15,10 +15,10 @@ tempest_distro_packages: - git - - 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 + - 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 - 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 @@ -34,7 +34,7 @@ tempest_service_distro_packages: - subunit-filters 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_service_available_aodh | bool) | ternary('python3-telemetry-tests-tempest', '') }}" diff --git a/vars/redhat-9.yml b/vars/redhat-9.yml index 513f6b7d..43d8e22a 100644 --- a/vars/redhat-9.yml +++ b/vars/redhat-9.yml @@ -15,10 +15,10 @@ tempest_distro_packages: - git - - 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 + - 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 - 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 @@ -34,7 +34,7 @@ tempest_service_distro_packages: - subunit-filters 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_service_available_aodh | bool) | ternary('python3-telemetry-tests-tempest', '') }}" diff --git a/zuul.d/playbooks/pre-tempestconf.yml b/zuul.d/playbooks/pre-tempestconf.yml index 524e40aa..570c4ad9 100644 --- a/zuul.d/playbooks/pre-tempestconf.yml +++ b/zuul.d/playbooks/pre-tempestconf.yml @@ -14,7 +14,7 @@ # limitations under the License. - hosts: all[0] - become: yes + become: true tasks: - name: Configure the tempestconf settings copy: