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: Ibcbb660f39c067e68b699436ef2da0903c8500fd
This commit is contained in:
Dmitriy Rabotyagov 2025-02-12 13:46:42 +01:00
parent 5ec1f6ab00
commit 79675d4c5f
13 changed files with 51 additions and 52 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

@ -17,8 +17,7 @@
### Verbosity Options ### Verbosity Options
### ###
debug: False debug: false
### ###
### Service setup options ### Service setup options
@ -97,7 +96,7 @@ neutron_venv_tag: "{{ venv_tag | default('untagged') }}"
### ###
# Fatal Deprecations # Fatal Deprecations
neutron_fatal_deprecations: False neutron_fatal_deprecations: false
# If ``neutron_api_workers`` is unset the system will use half the number of available VCPUs to # If ``neutron_api_workers`` is unset the system will use half the number of available VCPUs to
# compute the number of api workers to use with a default capping value of 16. # compute the number of api workers to use with a default capping value of 16.
@ -135,7 +134,7 @@ neutron_dhcp_config_list: []
# When dnsmasq_dns_servers are not set, # When dnsmasq_dns_servers are not set,
# and neutron_dnsmasq_noresolv is set to True, dnsmasq will reply with # and neutron_dnsmasq_noresolv is set to True, dnsmasq will reply with
# empty respose on DNS requests. # empty respose on DNS requests.
neutron_dnsmasq_noresolv: False neutron_dnsmasq_noresolv: false
### ###
### Tunable Overrides (Sorted alphabetically) ### Tunable Overrides (Sorted alphabetically)
@ -196,7 +195,7 @@ neutron_ovn_metadata_agent_init_overrides: {}
### UWSGI ### UWSGI
### ###
# NOTE(noonedeadpunk): uWSGI is still not fully supported. See: https://bugs.launchpad.net/neutron/+bug/1912359 # NOTE(noonedeadpunk): uWSGI is still not fully supported. See: https://bugs.launchpad.net/neutron/+bug/1912359
neutron_use_uwsgi: False neutron_use_uwsgi: false
neutron_wsgi_processes_max: 16 neutron_wsgi_processes_max: 16
neutron_wsgi_processes: "{{ [[ansible_facts['processor_vcpus'] | default(1), 1] | max * 2, neutron_wsgi_processes_max] | min }}" neutron_wsgi_processes: "{{ [[ansible_facts['processor_vcpus'] | default(1), 1] | max * 2, neutron_wsgi_processes_max] | min }}"
neutron_wsgi_threads: 1 neutron_wsgi_threads: 1
@ -369,7 +368,7 @@ neutron_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (group
### ###
neutron_designate_enabled: "{{ (groups['designate_all'] is defined) and (groups['designate_all'] | length > 0) }}" neutron_designate_enabled: "{{ (groups['designate_all'] is defined) and (groups['designate_all'] | length > 0) }}"
neutron_allow_reverse_dns_lookup: True neutron_allow_reverse_dns_lookup: true
neutron_ipv4_ptr_zone_prefix_size: 24 neutron_ipv4_ptr_zone_prefix_size: 24
neutron_ipv6_ptr_zone_prefix_size: 116 neutron_ipv6_ptr_zone_prefix_size: 116
@ -401,7 +400,7 @@ neutron_memcached_servers: "{{ memcached_servers }}"
# The neutron core plugin (ML2) is defined with neutron_plugin_type, # The neutron core plugin (ML2) is defined with neutron_plugin_type,
# you can not load multiple ML2 plugins as core. # you can not load multiple ML2 plugins as core.
neutron_plugin_type: 'ml2.ovn' neutron_plugin_type: "ml2.ovn"
# Additional ML2 plugins can be loaded with neutron_plugin_types (as list) # Additional ML2 plugins can be loaded with neutron_plugin_types (as list)
neutron_plugin_types: [] neutron_plugin_types: []
@ -447,7 +446,7 @@ neutron_local_ip: "{{ tunnel_address | default('127.0.0.1') }}"
neutron_ha_vrrp_auth_type: PASS neutron_ha_vrrp_auth_type: PASS
neutron_l3_ha_net_cidr: 169.254.192.0/18 neutron_l3_ha_net_cidr: 169.254.192.0/18
neutron_l3_cleanup_on_shutdown: False neutron_l3_cleanup_on_shutdown: false
## List of extensions enabled for L3 ## List of extensions enabled for L3
## The list can be extended by operator if needed, ie in user_variables.yml: ## The list can be extended by operator if needed, ie in user_variables.yml:
@ -469,7 +468,7 @@ neutron_dnsmasq_dns_servers: ""
neutron_dnsmasq_lease_max: 16777216 neutron_dnsmasq_lease_max: 16777216
# Specify if dnsmasq should send a route to metadata server through DHCP 121 message to VM # Specify if dnsmasq should send a route to metadata server through DHCP 121 message to VM
neutron_dnsmasq_force_metadata: False neutron_dnsmasq_force_metadata: false
# Specify the maximum number of DHCP agents per tenant network. Defaults to the total number of agents deployed # Specify the maximum number of DHCP agents per tenant network. Defaults to the total number of agents deployed
# neutron_dhcp_agents_max: 2 # neutron_dhcp_agents_max: 2
@ -520,13 +519,13 @@ neutron_ovn_vpn_agent_overrides: {}
neutron_ovn_vpn_agent_init_overrides: {} neutron_ovn_vpn_agent_init_overrides: {}
# OVN Defaults # OVN Defaults
neutron_ovn_ssl: True neutron_ovn_ssl: true
ovn_proto: "{{ (neutron_ovn_ssl) | ternary('ssl', 'tcp') }}" ovn_proto: "{{ (neutron_ovn_ssl) | ternary('ssl', 'tcp') }}"
neutron_ovn_primary_cluster_node: "{{ groups[neutron_services['neutron-ovn-northd']['group']] | first }}" neutron_ovn_primary_cluster_node: "{{ groups[neutron_services['neutron-ovn-northd']['group']] | first }}"
neutron_ovn_northd_service_name: ovn-northd neutron_ovn_northd_service_name: ovn-northd
neutron_ovn_controller_service_name: ovn-controller neutron_ovn_controller_service_name: ovn-controller
neutron_ovn_l3_scheduler: leastloaded neutron_ovn_l3_scheduler: leastloaded
neutron_ovn_distributed_fip: False neutron_ovn_distributed_fip: false
neutron_ovn_nb_connection: >- neutron_ovn_nb_connection: >-
{{ ovn_proto }}:{{ groups['neutron_ovn_northd'] | map('extract', hostvars, ['ansible_host']) | join(':6641,' + ovn_proto + ':') }}:6641 {{ ovn_proto }}:{{ groups['neutron_ovn_northd'] | map('extract', hostvars, ['ansible_host']) | join(':6641,' + ovn_proto + ':') }}:6641
neutron_ovn_sb_connection: >- neutron_ovn_sb_connection: >-
@ -540,12 +539,12 @@ neutron_ovn_sb_inactivity_probe: 60000
neutron_ovn_nb_inactivity_probe: 60000 neutron_ovn_nb_inactivity_probe: 60000
# OVN BGP Agent # OVN BGP Agent
neutron_ovn_bgp_enable: False neutron_ovn_bgp_enable: false
neutron_ovn_bgp_agent_group: "{{ neutron_ovn_distributed_fip | ternary('neutron_ovn_controller', 'neutron_ovn_gateway') }}" neutron_ovn_bgp_agent_group: "{{ neutron_ovn_distributed_fip | ternary('neutron_ovn_controller', 'neutron_ovn_gateway') }}"
neutron_ovn_bgp_agent_driver: nb_ovn_bgp_driver neutron_ovn_bgp_agent_driver: nb_ovn_bgp_driver
neutron_ovn_bgp_exposing_method: underlay neutron_ovn_bgp_exposing_method: underlay
neutron_ovn_bgp_expose_tenant_networks: False neutron_ovn_bgp_expose_tenant_networks: false
neutron_ovn_bgp_expose_ipv6_gua_tenant_networks: False neutron_ovn_bgp_expose_ipv6_gua_tenant_networks: false
# Provide config needed for BGP peering # Provide config needed for BGP peering
# neutron_ovn_bgp_config: # neutron_ovn_bgp_config:
# AS: 64999 # AS: 64999
@ -644,7 +643,7 @@ neutron_ovn_pki_install_certificates:
ovs_datapath: "netdev" ovs_datapath: "netdev"
ovs_dpdk_pci_addresses: [] ovs_dpdk_pci_addresses: []
ovs_dpdk_driver: vfio-pci ovs_dpdk_driver: vfio-pci
ovs_dpdk_support: False ovs_dpdk_support: false
ovs_dpdk_lcore_mask: 1 ovs_dpdk_lcore_mask: 1
ovs_dpdk_pmd_cpu_mask: 2 ovs_dpdk_pmd_cpu_mask: 2
ovs_dpdk_socket_mem: "1024" ovs_dpdk_socket_mem: "1024"
@ -669,7 +668,7 @@ neutron_pki_setup_host: "{{ openstack_pki_setup_host | default('localhost') }}"
neutron_pki_keys_path: "{{ neutron_pki_dir ~ '/certs/private/' }}" neutron_pki_keys_path: "{{ neutron_pki_dir ~ '/certs/private/' }}"
neutron_pki_certs_path: "{{ neutron_pki_dir ~ '/certs/certs/' }}" neutron_pki_certs_path: "{{ neutron_pki_dir ~ '/certs/certs/' }}"
neutron_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}" neutron_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}"
neutron_pki_regen_cert: '' neutron_pki_regen_cert: ""
neutron_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}" neutron_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}"
neutron_pki_certificates: neutron_pki_certificates:
- name: "neutron_{{ ansible_facts['hostname'] }}" - name: "neutron_{{ ansible_facts['hostname'] }}"

View File

@ -17,7 +17,7 @@
service: service:
name: "{{ item.service_name }}" name: "{{ item.service_name }}"
state: "stopped" state: "stopped"
daemon_reload: yes daemon_reload: true
with_items: "{{ filtered_neutron_services }}" with_items: "{{ filtered_neutron_services }}"
register: _stop register: _stop
until: _stop is success until: _stop is success
@ -29,7 +29,6 @@
- "systemd service changed" - "systemd service changed"
- "cert installed" - "cert installed"
# NOTE # NOTE
# When restarting neutron-l3-agent, a non-default systemd KillMode of 'process' is used # When restarting neutron-l3-agent, a non-default systemd KillMode of 'process' is used
# to prevent Keepalived from exiting and causing a data-plane outage. As a result of this # to prevent Keepalived from exiting and causing a data-plane outage. As a result of this
@ -89,7 +88,7 @@
- name: Perform a DB contract - name: Perform a DB contract
command: "{{ neutron_bin }}/neutron-db-manage upgrade --contract" command: "{{ neutron_bin }}/neutron-db-manage upgrade --contract"
become: yes become: true
become_user: "{{ neutron_system_user_name }}" become_user: "{{ neutron_system_user_name }}"
changed_when: false changed_when: false
when: when:
@ -104,7 +103,7 @@
name: "{{ item.service_name }}" name: "{{ item.service_name }}"
enabled: "{{ item.enabled | default(True) }}" enabled: "{{ item.enabled | default(True) }}"
state: "{{ item.state | default('started') }}" state: "{{ item.state | default('started') }}"
daemon_reload: yes daemon_reload: true
with_items: "{{ filtered_neutron_services }}" with_items: "{{ filtered_neutron_services }}"
register: _start register: _start
until: _start is success until: _start is success

View File

@ -12,8 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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.
- name: Importing neutron_check tasks - name: Importing neutron_check tasks
import_tasks: neutron_check.yml import_tasks: neutron_check.yml
@ -207,8 +205,8 @@
systemd: systemd:
name: "{{ item['service_name'] }}" name: "{{ item['service_name'] }}"
state: stopped state: stopped
enabled: False enabled: false
masked: True masked: true
when: when:
- item['group'] in group_names - item['group'] in group_names
- item['service_name'] ~ '.service' in ansible_facts.services - item['service_name'] ~ '.service' in ansible_facts.services

View File

@ -21,15 +21,15 @@
until: apparmor_packages is success until: apparmor_packages is success
retries: 5 retries: 5
delay: 2 delay: 2
become: yes become: true
delegate_to: "{{ physical_host | default('localhost') }}" delegate_to: "{{ physical_host | default('localhost') }}"
- name: Ensure apparmor service is running - name: Ensure apparmor service is running
systemd: systemd:
name: "apparmor" name: "apparmor"
enabled: yes enabled: true
state: "started" state: "started"
become: yes become: true
delegate_to: "{{ physical_host | default('localhost') }}" delegate_to: "{{ physical_host | default('localhost') }}"
- name: "Disable apparmor profile" - name: "Disable apparmor profile"
@ -50,12 +50,12 @@
failed_when: _apparmor_profile_disabled.rc not in [0,2] failed_when: _apparmor_profile_disabled.rc not in [0,2]
args: args:
executable: /bin/bash executable: /bin/bash
become: yes become: true
delegate_to: "{{ physical_host | default('localhost') }}" delegate_to: "{{ physical_host | default('localhost') }}"
with_items: with_items:
- profile: 'usr.sbin.haproxy' - profile: "usr.sbin.haproxy"
process: 'haproxy' process: "haproxy"
- profile: 'bin.ping' - profile: "bin.ping"
process: 'ping' process: "ping"
- profile: 'usr.sbin.dnsmasq' - profile: "usr.sbin.dnsmasq"
process: 'dnsmasq' process: "dnsmasq"

View File

@ -15,7 +15,7 @@
- name: Perform a DB expand - name: Perform a DB expand
command: "{{ neutron_bin }}/neutron-db-manage --config-file {{ neutron_conf_version_dir }}/neutron.conf upgrade --expand" command: "{{ neutron_bin }}/neutron-db-manage --config-file {{ neutron_conf_version_dir }}/neutron.conf upgrade --expand"
become: yes become: true
become_user: "{{ neutron_system_user_name }}" become_user: "{{ neutron_system_user_name }}"
changed_when: false changed_when: false
when: when:
@ -34,7 +34,7 @@
command: "{{ neutron_bin }}/neutron-db-manage --config-file {{ neutron_conf_version_dir }}/neutron.conf has_offline_migrations" command: "{{ neutron_bin }}/neutron-db-manage --config-file {{ neutron_conf_version_dir }}/neutron.conf has_offline_migrations"
environment: environment:
LANGUAGE: en_US.UTF-8 LANGUAGE: en_US.UTF-8
become: yes become: true
become_user: "{{ neutron_system_user_name }}" become_user: "{{ neutron_system_user_name }}"
when: when:
- "_neutron_is_first_play_host" - "_neutron_is_first_play_host"

View File

@ -79,7 +79,7 @@
- name: Retrieve the constraints URL - name: Retrieve the constraints URL
uri: uri:
url: "{{ neutron_upper_constraints_url }}" url: "{{ neutron_upper_constraints_url }}"
return_content: yes return_content: true
register: _u_c_contents register: _u_c_contents
check_mode: false check_mode: false
@ -137,8 +137,8 @@
# NOTE(hwoarang) contains may share the same physical host so we only # NOTE(hwoarang) contains may share the same physical host so we only
# need to execute the apparmor configuration once per physical host. # need to execute the apparmor configuration once per physical host.
- name: Record the first container on each physical host - name: Record the first container on each physical host
delegate_to: 'localhost' delegate_to: "localhost"
run_once: True run_once: true
set_fact: set_fact:
neutron_apparmor_hosts: | neutron_apparmor_hosts: |
{%- set apparmor_hosts = [] -%} {%- set apparmor_hosts = [] -%}

View File

@ -108,7 +108,7 @@
fetch: fetch:
src: "{{ item.target_f }}.original" src: "{{ item.target_f }}.original"
dest: "{{ item.tmp_f }}" dest: "{{ item.tmp_f }}"
flat: yes flat: true
changed_when: false changed_when: false
with_items: "{{ neutron_core_files }}" with_items: "{{ neutron_core_files }}"
run_once: true run_once: true

View File

@ -75,7 +75,7 @@
mode: "0755" mode: "0755"
- path: "{{ neutron_system_home_folder }}/ovn-metadata-proxy" - path: "{{ neutron_system_home_folder }}/ovn-metadata-proxy"
mode: "u=rwX,g=rX,o=rX" mode: "u=rwX,g=rX,o=rX"
recurse: True recurse: true
condition: "{{ (neutron_plugin_type == 'ml2.ovn' and neutron_services['neutron-ovn-metadata-agent']['group'] in group_names) }}" condition: "{{ (neutron_plugin_type == 'ml2.ovn' and neutron_services['neutron-ovn-metadata-agent']['group'] in group_names) }}"
- path: "{{ neutron_system_home_folder }}/ha_confs" - path: "{{ neutron_system_home_folder }}/ha_confs"
state: "{{ (neutron_plugin_type == 'ml2.ovn') | ternary('absent', 'directory') }}" state: "{{ (neutron_plugin_type == 'ml2.ovn') | ternary('absent', 'directory') }}"

View File

@ -1,3 +1,4 @@
---
# (c) 2018, James Denton <james.denton@rackspace.com> # (c) 2018, James Denton <james.denton@rackspace.com>
# #
# Copyright 2018, Rackspace US, Inc. # Copyright 2018, Rackspace US, Inc.
@ -42,7 +43,7 @@
systemd: systemd:
name: "{{ neutron_ovn_northd_service_name }}" name: "{{ neutron_ovn_northd_service_name }}"
state: started state: started
enabled: yes enabled: true
when: when:
- neutron_services['neutron-ovn-northd']['group'] in group_names - neutron_services['neutron-ovn-northd']['group'] in group_names
@ -50,7 +51,7 @@
systemd: systemd:
name: "{{ neutron_ovn_controller_service_name }}" name: "{{ neutron_ovn_controller_service_name }}"
state: "{{ (ovn_controller_config.changed) | ternary('restarted', 'started') }}" state: "{{ (ovn_controller_config.changed) | ternary('restarted', 'started') }}"
enabled: yes enabled: true
when: when:
- neutron_services['neutron-ovn-controller']['group'] in group_names - neutron_services['neutron-ovn-controller']['group'] in group_names

View File

@ -48,7 +48,7 @@
systemd: systemd:
name: "{{ dpdk_service_name }}" name: "{{ dpdk_service_name }}"
state: restarted state: restarted
enabled: yes enabled: true
when: when:
- neutron_services['neutron-openvswitch-agent']['group'] in group_names - neutron_services['neutron-openvswitch-agent']['group'] in group_names
- '"nova_compute" in group_names' - '"nova_compute" in group_names'
@ -57,7 +57,7 @@
systemd: systemd:
name: "{{ neutron_ovs_service_name }}" name: "{{ neutron_ovs_service_name }}"
state: restarted state: restarted
enabled: yes enabled: true
when: when:
- neutron_services['neutron-openvswitch-agent']['group'] in group_names - neutron_services['neutron-openvswitch-agent']['group'] in group_names

View File

@ -1,3 +1,4 @@
---
# (c) 2018, James Denton <james.denton@rackspace.com> # (c) 2018, James Denton <james.denton@rackspace.com>
# #
# Copyright 2018, Rackspace US, Inc. # Copyright 2018, Rackspace US, Inc.

View File

@ -182,7 +182,7 @@ neutron_plugins:
l2_population: "{{ neutron_l2_population }}" l2_population: "{{ neutron_l2_population }}"
mechanisms: "openvswitch" mechanisms: "openvswitch"
l3_agent_mode: "{% if 'network_hosts' in group_names %}dvr_snat{% else %}dvr{% endif %}" l3_agent_mode: "{% if 'network_hosts' in group_names %}dvr_snat{% else %}dvr{% endif %}"
router_distributed: True router_distributed: true
plugin_conf_ini_overrides: "{{ neutron_ml2_conf_ini_overrides }}" plugin_conf_ini_overrides: "{{ neutron_ml2_conf_ini_overrides }}"
plugin_core: ml2 plugin_core: ml2
plugin_ini: plugins/ml2/ml2_conf.ini plugin_ini: plugins/ml2/ml2_conf.ini
@ -205,7 +205,7 @@ neutron_plugins:
ml2.genericswitch: ml2.genericswitch:
drivers_type: "vlan" drivers_type: "vlan"
mechanisms: "genericswitch" mechanisms: "genericswitch"
plugin_conf_bare: True plugin_conf_bare: true
plugin_conf_ini_overrides: "{{ neutron_ml2_conf_genericswitch_ini_overrides }}" plugin_conf_ini_overrides: "{{ neutron_ml2_conf_genericswitch_ini_overrides }}"
plugin_core: ml2 plugin_core: ml2
plugin_ini: plugins/ml2/ml2_conf_genericswitch.ini plugin_ini: plugins/ml2/ml2_conf_genericswitch.ini
@ -473,7 +473,7 @@ neutron_services:
neutron-server: neutron-server:
group: neutron_server group: neutron_server
service_name: neutron-server service_name: neutron-server
service_en: True service_en: true
start_order: 1 start_order: 1
wsgi_app: "{{ neutron_use_uwsgi }}" wsgi_app: "{{ neutron_use_uwsgi }}"
uwsgi_overrides: "{{ neutron_api_uwsgi_ini_overrides }}" uwsgi_overrides: "{{ neutron_api_uwsgi_ini_overrides }}"
@ -496,7 +496,7 @@ neutron_services:
neutron-rpc-server: neutron-rpc-server:
group: neutron_server group: neutron_server
service_name: neutron-rpc-server service_name: neutron-rpc-server
service_en: True service_en: true
enabled: "{{ neutron_use_uwsgi }}" enabled: "{{ neutron_use_uwsgi }}"
state: "{{ neutron_use_uwsgi | ternary('started', 'stopped') }}" state: "{{ neutron_use_uwsgi | ternary('started', 'stopped') }}"
init_config_overrides: "{{ neutron_rpc_server_init_overrides | combine(neutron_server_init_overrides) }}" init_config_overrides: "{{ neutron_rpc_server_init_overrides | combine(neutron_server_init_overrides) }}"
@ -510,7 +510,7 @@ neutron_services:
neutron-periodic-workers: neutron-periodic-workers:
group: neutron_server group: neutron_server
service_name: neutron-periodic-workers service_name: neutron-periodic-workers
service_en: True service_en: true
enabled: "{{ neutron_use_uwsgi }}" enabled: "{{ neutron_use_uwsgi }}"
state: "{{ neutron_use_uwsgi | ternary('started', 'stopped') }}" state: "{{ neutron_use_uwsgi | ternary('started', 'stopped') }}"
init_config_overrides: "{{ neutron_periodic_workers_init_overrides | combine(neutron_server_init_overrides) }}" init_config_overrides: "{{ neutron_periodic_workers_init_overrides | combine(neutron_server_init_overrides) }}"
@ -547,10 +547,10 @@ neutron_services:
start_order: 3 start_order: 3
neutron-ovn-northd: neutron-ovn-northd:
group: neutron_ovn_northd group: neutron_ovn_northd
service_en: False service_en: false
neutron-ovn-controller: neutron-ovn-controller:
group: neutron_ovn_controller group: neutron_ovn_controller
service_en: False service_en: false
neutron-ovn-bgp-agent: neutron-ovn-bgp-agent:
group: "{{ neutron_ovn_bgp_agent_group }}" group: "{{ neutron_ovn_bgp_agent_group }}"
systemd_lock_dir: /run/lock/ovn-bgp-agent systemd_lock_dir: /run/lock/ovn-bgp-agent