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: I5e295a9f62f347a9cf6ea8f812c5ebebe2a6c310
This commit is contained in:
Dmitriy Rabotyagov 2025-02-12 15:25:19 +01:00
parent 861f5b989e
commit f25f9f2af7
9 changed files with 64 additions and 64 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
# Set the host which will execute the shade modules # Set the host which will execute the shade modules
# for the service setup. The host must already have # for the service setup. The host must already have
@ -143,10 +143,10 @@ horizon_service_name: horizon
## Session configuration ## Session configuration
# Specifies the timespan in seconds inactivity, until a user is considered as # Specifies the timespan in seconds inactivity, until a user is considered as
# logged out # logged out
horizon_session_engine: 'django.contrib.sessions.backends.cache' horizon_session_engine: "django.contrib.sessions.backends.cache"
horizon_session_caches: horizon_session_caches:
default: default:
BACKEND: 'django.core.cache.backends.memcached.PyMemcacheCache' BACKEND: "django.core.cache.backends.memcached.PyMemcacheCache"
LOCATION: "{{ horizon_memcached_servers.split(',') }}" LOCATION: "{{ horizon_memcached_servers.split(',') }}"
horizon_session_timeout: 1800 horizon_session_timeout: 1800
@ -155,7 +155,7 @@ horizon_help_url: https://docs.openstack.org/horizon/latest/user/
## Horizon ALLOWED_HOSTS ## Horizon ALLOWED_HOSTS
horizon_allowed_hosts: horizon_allowed_hosts:
- '*' - "*"
## Installation directories ## Installation directories
# When horizon_lib_dir is not defined, it will be detected automatically # When horizon_lib_dir is not defined, it will be detected automatically
@ -183,31 +183,30 @@ horizon_overview_days_range: 1
# require any extra configuration # require any extra configuration
horizon_images_upload_mode: direct horizon_images_upload_mode: direct
horizon_images_allow_location: False horizon_images_allow_location: false
horizon_time_zone: UTC horizon_time_zone: UTC
horizon_enforce_password_check: False horizon_enforce_password_check: false
horizon_disable_password_reveal: False horizon_disable_password_reveal: false
horizon_enable_password_retrieve: False horizon_enable_password_retrieve: false
horizon_enable_password_autocomplete: False horizon_enable_password_autocomplete: false
horizon_enable_heatstack_user_pass: True horizon_enable_heatstack_user_pass: true
# If nova_libvirt_inject_password is set to True, then this can also be enabled: # If nova_libvirt_inject_password is set to True, then this can also be enabled:
horizon_can_set_password: False horizon_can_set_password: false
horizon_enable_cinder_backup: False horizon_enable_cinder_backup: false
# Enables IPv6 support in Horizon, such as managing network subnets # Enables IPv6 support in Horizon, such as managing network subnets
horizon_enable_ipv6: True horizon_enable_ipv6: true
# Enables router support in Horizon, disable if you don't have Neutron L3 agent # Enables router support in Horizon, disable if you don't have Neutron L3 agent
horizon_enable_router: True horizon_enable_router: true
# Disable/Enable simplified floating IP address management for deployments with # Disable/Enable simplified floating IP address management for deployments with
# multiple floating IP pools or complex network requirements. # multiple floating IP pools or complex network requirements.
horizon_simple_ip_management: True horizon_simple_ip_management: true
# To enable ha router support in horizon set to True # To enable ha router support in horizon set to True
horizon_enable_ha_router: False horizon_enable_ha_router: false
# Provide default DNS servers to use when a subnet is created. # Provide default DNS servers to use when a subnet is created.
horizon_default_dns_nameservers: [] horizon_default_dns_nameservers: []
# Provide list of network types that are available for creation # Provide list of network types that are available for creation
horizon_network_provider_types: "{{ neutron_ml2_drivers_type | default('geneve,vlan,flat') }}" horizon_network_provider_types: "{{ neutron_ml2_drivers_type | default('geneve,vlan,flat') }}"
@ -217,7 +216,7 @@ horizon_network_provider_types: "{{ neutron_ml2_drivers_type | default('geneve,v
# where iframes are not used in deployment. Default setting is True. # where iframes are not used in deployment. Default setting is True.
# For more information see: # For more information see:
# http://tinyurl.com/anticlickjack # http://tinyurl.com/anticlickjack
horizon_disallow_iframe_embed: True horizon_disallow_iframe_embed: true
# WSGI tuning parameters # WSGI tuning parameters
# horizon_wsgi_processes: 4 # horizon_wsgi_processes: 4
@ -269,10 +268,10 @@ horizon_keystone_endpoint: "{{ keystone_service_internalurl }}"
## Horizon Multi-Domain Support ## Horizon Multi-Domain Support
# these variables should only be changed if horizon_keystone_endpoint is a Keystone v3 API endpoint # these variables should only be changed if horizon_keystone_endpoint is a Keystone v3 API endpoint
horizon_keystone_multidomain_support: False horizon_keystone_multidomain_support: false
# It is strongly advised NOT to enable dropdown for public clouds, as advertising enabled domains # It is strongly advised NOT to enable dropdown for public clouds, as advertising enabled domains
# to unauthenticated customers irresponsibly exposes private information. # to unauthenticated customers irresponsibly exposes private information.
horizon_keystone_multidomain_dropdown: False horizon_keystone_multidomain_dropdown: false
horizon_keystone_default_domain: Default horizon_keystone_default_domain: Default
@ -282,7 +281,7 @@ horizon_keystone_default_domain: Default
horizon_keystone_multidomain_choices: "(('{{ horizon_keystone_default_domain }}', '{{ horizon_keystone_default_domain }}'),)" horizon_keystone_multidomain_choices: "(('{{ horizon_keystone_default_domain }}', '{{ horizon_keystone_default_domain }}'),)"
# Enable/disable v2 openrc file download in horizon. # Enable/disable v2 openrc file download in horizon.
horizon_show_keystone_v2_rc: True horizon_show_keystone_v2_rc: true
### Set the cacert pem for Keystone if you'd like Horizon to verify it. ### Set the cacert pem for Keystone if you'd like Horizon to verify it.
# horizon_cacert_pem: /path/to/cacert.pem # horizon_cacert_pem: /path/to/cacert.pem
@ -300,24 +299,24 @@ horizon_ssl_csrf_trusted_origins: []
horizon_default_role_name: member horizon_default_role_name: member
## Launch instance ## Launch instance
horizon_launch_instance_legacy: False horizon_launch_instance_legacy: false
horizon_launch_instance_ng: True horizon_launch_instance_ng: true
horizon_launch_instance_defaults: horizon_launch_instance_defaults:
config_drive: False config_drive: false
enable_scheduler_hints: True enable_scheduler_hints: true
disable_image: False disable_image: false
disable_instance_snapshot: False disable_instance_snapshot: false
disable_volume: False disable_volume: false
disable_volume_snapshot: False disable_volume_snapshot: false
create_volume: True create_volume: true
hide_create_volume: False hide_create_volume: false
## Adjutant UI Panel ## Adjutant UI Panel
horizon_enable_adjutant_ui: "{{ (groups['adjutant_all'] is defined) and (groups['adjutant_all'] | length > 0) }}" horizon_enable_adjutant_ui: "{{ (groups['adjutant_all'] is defined) and (groups['adjutant_all'] | length > 0) }}"
## Barbican UI Panel ## Barbican UI Panel
### Barbican UI is just a cookie-cutter scaffolding and does not provide any functionality at this time. ### Barbican UI is just a cookie-cutter scaffolding and does not provide any functionality at this time.
horizon_enable_barbican_ui: False horizon_enable_barbican_ui: false
## Blazar UI Panel ## Blazar UI Panel
horizon_enable_blazar_ui: "{{ (groups['blazar_all'] is defined) and (groups['blazar_all'] | length > 0) }}" horizon_enable_blazar_ui: "{{ (groups['blazar_all'] is defined) and (groups['blazar_all'] | length > 0) }}"
@ -363,7 +362,7 @@ horizon_enable_tacker_ui: "{{ (groups['tacker_all'] is defined) and (groups['tac
horizon_enable_trove_ui: "{{ (groups['trove_all'] is defined) and (groups['trove_all'] | length > 0) }}" horizon_enable_trove_ui: "{{ (groups['trove_all'] is defined) and (groups['trove_all'] | length > 0) }}"
## Watcher UI Panel ## Watcher UI Panel
horizon_enable_watcher_ui: False horizon_enable_watcher_ui: false
## Zun UI Panel ## Zun UI Panel
horizon_enable_zun_ui: "{{ (groups['zun_all'] is defined) and (groups['zun_all'] | length > 0) }}" horizon_enable_zun_ui: "{{ (groups['zun_all'] is defined) and (groups['zun_all'] | length > 0) }}"
@ -437,7 +436,7 @@ horizon_listen_ports:
horizon_pip_packages: horizon_pip_packages:
- "git+{{ horizon_git_repo }}@{{ horizon_git_install_branch }}#egg=horizon" - "git+{{ horizon_git_repo }}@{{ horizon_git_install_branch }}#egg=horizon"
- "git+{{ openstack_github_base_url }}/Kronuz/pyScss@60414f5d573315a8458b5fbcdf69e5c648c44a9a" # needed for python>=3.11 - "git+{{ openstack_github_base_url }}/Kronuz/pyScss@60414f5d573315a8458b5fbcdf69e5c648c44a9a" # needed for python>=3.11
- pymemcache - pymemcache
- python-memcached - python-memcached
@ -495,7 +494,7 @@ horizon_optional_pip_packages: []
# This variable is used to update the horizon translations from # This variable is used to update the horizon translations from
# Zanata, this can be set to "True" when testing translations, # Zanata, this can be set to "True" when testing translations,
# but should otherwise be left as False. # but should otherwise be left as False.
horizon_translations_update: False horizon_translations_update: false
# This variable is used to define the version of the project # This variable is used to define the version of the project
# (horizon) to pull from Zanata. Default value is master, # (horizon) to pull from Zanata. Default value is master,
@ -528,10 +527,10 @@ horizon_keystone_admin_roles:
# federation protocols and identity provider/federation protocol # federation protocols and identity provider/federation protocol
# horizon_websso_keystone_url: "{{ horizon_keystone_endpoint }}" # horizon_websso_keystone_url: "{{ horizon_keystone_endpoint }}"
horizon_websso_initial_choice: "credentials" horizon_websso_initial_choice: "credentials"
horizon_websso_default_redirect: False horizon_websso_default_redirect: false
horizon_websso_default_redirect_region: "{{ horizon_websso_keystone_url | default(horizon_keystone_endpoint) }}" horizon_websso_default_redirect_region: "{{ horizon_websso_keystone_url | default(horizon_keystone_endpoint) }}"
horizon_websso_default_redirect_logout: "" horizon_websso_default_redirect_logout: ""
horizon_websso_use_http_referer: True horizon_websso_use_http_referer: true
### ###
### Backend TLS ### Backend TLS
@ -549,7 +548,7 @@ horizon_pki_certs_path: "{{ horizon_pki_dir ~ '/certs/certs/' }}"
horizon_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}" horizon_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}"
horizon_pki_intermediate_cert_path: >- horizon_pki_intermediate_cert_path: >-
{{ horizon_pki_dir ~ '/roots/' ~ horizon_pki_intermediate_cert_name ~ '/certs/' ~ horizon_pki_intermediate_cert_name ~ '.crt' }} {{ horizon_pki_dir ~ '/roots/' ~ horizon_pki_intermediate_cert_name ~ '/certs/' ~ horizon_pki_intermediate_cert_name ~ '.crt' }}
horizon_pki_regen_cert: '' horizon_pki_regen_cert: ""
horizon_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}" horizon_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}"
horizon_pki_certificates: horizon_pki_certificates:
- name: "horizon_{{ ansible_facts['hostname'] }}" - name: "horizon_{{ ansible_facts['hostname'] }}"

View File

@ -26,7 +26,7 @@
- name: Restart wsgi process - name: Restart wsgi process
service: service:
name: "{{ horizon_system_service_name }}" name: "{{ horizon_system_service_name }}"
enabled: yes enabled: true
state: "restarted" state: "restarted"
daemon_reload: "{{ (ansible_facts['service_mgr'] == 'systemd') | ternary('yes', omit) }}" daemon_reload: "{{ (ansible_facts['service_mgr'] == 'systemd') | ternary('yes', omit) }}"
listen: listen:

View File

@ -17,7 +17,7 @@
apache2_module: apache2_module:
name: "{{ item.name }}" name: "{{ item.name }}"
state: "{{ item.state }}" state: "{{ item.state }}"
ignore_configcheck: yes ignore_configcheck: true
warn_mpm_absent: false warn_mpm_absent: false
with_items: "{{ horizon_apache_mpms | sort(attribute='state') }}" with_items: "{{ horizon_apache_mpms | sort(attribute='state') }}"
when: when:
@ -40,7 +40,7 @@
apache2_module: apache2_module:
name: "{{ item.name }}" name: "{{ item.name }}"
state: "{{ item.state }}" state: "{{ item.state }}"
ignore_configcheck: yes ignore_configcheck: true
with_items: with_items:
- "{{ horizon_apache_modules }}" - "{{ horizon_apache_modules }}"
when: when:
@ -83,14 +83,14 @@
- name: Ensure Apache ServerTokens - name: Ensure Apache ServerTokens
lineinfile: lineinfile:
dest: "{{ horizon_apache_security_conf }}" dest: "{{ horizon_apache_security_conf }}"
regexp: '^ServerTokens' regexp: "^ServerTokens"
line: "ServerTokens {{ horizon_apache_servertokens }}" line: "ServerTokens {{ horizon_apache_servertokens }}"
notify: Restart wsgi process notify: Restart wsgi process
- name: Ensure Apache ServerSignature - name: Ensure Apache ServerSignature
lineinfile: lineinfile:
dest: "{{ horizon_apache_security_conf }}" dest: "{{ horizon_apache_security_conf }}"
regexp: '^ServerSignature' regexp: "^ServerSignature"
line: "ServerSignature {{ horizon_apache_serversignature }}" line: "ServerSignature {{ horizon_apache_serversignature }}"
notify: Restart wsgi process notify: Restart wsgi process
@ -99,7 +99,7 @@
- name: Remove Listen from Apache config - name: Remove Listen from Apache config
lineinfile: lineinfile:
dest: "{{ horizon_apache_security_conf }}" dest: "{{ horizon_apache_security_conf }}"
regexp: '^(Listen.*)' regexp: "^(Listen.*)"
backrefs: yes backrefs: true
line: '#\1' line: "#\\1"
notify: Restart wsgi process notify: Restart wsgi process

View File

@ -21,7 +21,7 @@
- name: Retrieve the constraints URL - name: Retrieve the constraints URL
uri: uri:
url: "{{ horizon_upper_constraints_url }}" url: "{{ horizon_upper_constraints_url }}"
return_content: yes return_content: true
register: _u_c_contents register: _u_c_contents
until: _u_c_contents is success until: _u_c_contents is success
retries: 15 retries: 15

View File

@ -39,7 +39,7 @@
mode: "{{ item.mode | default(omit) }}" mode: "{{ item.mode | default(omit) }}"
recurse: "{{ item.recurse | default(True) }}" recurse: "{{ item.recurse | default(True) }}"
with_items: with_items:
- { path: "{{ horizon_lib_dir }}", fixup: True } - { path: "{{ horizon_lib_dir }}", fixup: true }
- { path: "/etc/openstack-dashboard", fixup: "{{ (ansible_facts['os_family'] | lower) == 'redhat' }}" } - { path: "/etc/openstack-dashboard", fixup: "{{ (ansible_facts['os_family'] | lower) == 'redhat' }}" }
when: item.fixup when: item.fixup
@ -89,7 +89,7 @@
owner: "{{ horizon_system_user_name }}" owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}" group: "{{ horizon_system_group_name }}"
state: "link" state: "link"
force: yes force: true
with_items: with_items:
- { src: "/etc/horizon/local_settings.py", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.py" } - { src: "/etc/horizon/local_settings.py", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.py" }
@ -133,14 +133,14 @@
- name: Collect static files - name: Collect static files
command: "{{ horizon_manage }} collectstatic --noinput" command: "{{ horizon_manage }} collectstatic --noinput"
become: yes become: true
become_user: "{{ horizon_system_user_name }}" become_user: "{{ horizon_system_user_name }}"
changed_when: false changed_when: false
notify: Restart wsgi process notify: Restart wsgi process
- name: Compress static files - name: Compress static files
command: "{{ horizon_manage }} compress --force" command: "{{ horizon_manage }} compress --force"
become: yes become: true
become_user: "{{ horizon_system_user_name }}" become_user: "{{ horizon_system_user_name }}"
changed_when: false changed_when: false
notify: Restart wsgi process notify: Restart wsgi process

View File

@ -31,9 +31,9 @@
paths: "{{ horizon_lib_dir }}" paths: "{{ horizon_lib_dir }}"
patterns: "^.*(dashboard|ui)$" patterns: "^.*(dashboard|ui)$"
file_type: directory file_type: directory
use_regex: yes use_regex: true
excludes: "openstack_dashboard" excludes: "openstack_dashboard"
recurse: no recurse: false
register: found_dashboards register: found_dashboards
- name: Registering panels - name: Registering panels
@ -48,7 +48,7 @@
{{ dashboard_path }} {{ dashboard_path }}
patterns: ["^_[0-9]{2,4}_.*.py$"] patterns: ["^_[0-9]{2,4}_.*.py$"]
file_type: file file_type: file
use_regex: yes use_regex: true
register: found_panels register: found_panels
- name: Registering settings - name: Registering settings
@ -63,7 +63,7 @@
{{ dashboard_path }} {{ dashboard_path }}
patterns: ["^_[0-9]{2,4}_.*.py$"] patterns: ["^_[0-9]{2,4}_.*.py$"]
file_type: file file_type: file
use_regex: yes use_regex: true
register: found_settings register: found_settings
- name: Registering default policy files - name: Registering default policy files
@ -76,9 +76,9 @@
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{{ policy_path }} {{ policy_path }}
patterns: ['^.*\.(json|yaml)$'] patterns: ["^.*\\.(json|yaml)$"]
file_type: file file_type: file
use_regex: yes use_regex: true
register: found_default_policy register: found_default_policy
- name: Registering policy files - name: Registering policy files
@ -93,7 +93,7 @@
{{ policy_path }} {{ policy_path }}
patterns: ["^.*_policy.(json|yaml)$"] patterns: ["^.*_policy.(json|yaml)$"]
file_type: file file_type: file
use_regex: yes use_regex: true
register: found_policy register: found_policy
- name: Link default policy files - name: Link default policy files

View File

@ -17,10 +17,10 @@
ansible.posix.sysctl: ansible.posix.sysctl:
name: net.ipv4.ip_unprivileged_port_start name: net.ipv4.ip_unprivileged_port_start
value: "0" value: "0"
sysctl_set: yes sysctl_set: true
sysctl_file: "{{ horizon_sysctl_file }}" sysctl_file: "{{ horizon_sysctl_file }}"
state: present state: present
reload: yes reload: true
- name: Import uwsgi role - name: Import uwsgi role
include_role: include_role:

View File

@ -16,14 +16,14 @@
_horizon_translations_pull: _horizon_translations_pull:
- project: "horizon" - project: "horizon"
branch: "{{ horizon_translations_project_version }}" branch: "{{ horizon_translations_project_version }}"
enabled: True enabled: true
module: module:
- horizon - horizon
- openstack_auth - openstack_auth
- openstack_dashboard - openstack_dashboard
- project: "designate-dashboard" - project: "designate-dashboard"
branch: "{{ horizon_translations_project_version }}" branch: "{{ horizon_translations_project_version }}"
enabled: True enabled: true
module: designatedashboard module: designatedashboard
- project: "heat-dashboard" - project: "heat-dashboard"
branch: "{{ horizon_translations_project_version }}" branch: "{{ horizon_translations_project_version }}"
@ -31,11 +31,11 @@ _horizon_translations_pull:
module: heat_dashboard module: heat_dashboard
- project: "magnum-ui" - project: "magnum-ui"
branch: "{{ horizon_translations_project_version }}" branch: "{{ horizon_translations_project_version }}"
enabled: True enabled: true
module: magnum_ui module: magnum_ui
- project: "trove-dashboard" - project: "trove-dashboard"
branch: "{{ horizon_translations_project_version }}" branch: "{{ horizon_translations_project_version }}"
enabled: True enabled: true
module: trove_dashboard module: trove_dashboard
horizon_dashboard_panel_dir: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled" horizon_dashboard_panel_dir: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled"