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: If512039bae99218e054a8841cb32c3903b616ed7
This commit is contained in:
Dmitriy Rabotyagov 2025-02-12 12:31:16 +01:00
parent c2684a0a9e
commit a6d3897090
7 changed files with 45 additions and 45 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

@ -16,7 +16,7 @@
# Defaults file for openstack-ansible-ironic # Defaults file for openstack-ansible-ironic
# Verbosity Options # Verbosity Options
debug: False debug: false
# python venv executable # python venv executable
ironic_venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}" ironic_venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}"
@ -66,7 +66,7 @@ ironic_services:
group: ironic_api group: ironic_api
service_name: ironic-api service_name: ironic-api
init_config_overrides: "{{ ironic_api_init_config_overrides }}" init_config_overrides: "{{ ironic_api_init_config_overrides }}"
wsgi_app: True wsgi_app: true
wsgi_name: ironic-api-wsgi wsgi_name: ironic-api-wsgi
uwsgi_overrides: "{{ ironic_api_uwsgi_ini_overrides }}" uwsgi_overrides: "{{ ironic_api_uwsgi_ini_overrides }}"
uwsgi_port: "{{ ironic_service_port }}" uwsgi_port: "{{ ironic_service_port }}"
@ -125,7 +125,7 @@ ironic_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
# Enable interaction with Nova and Neutron from 2024.1 with default policy # Enable interaction with Nova and Neutron from 2024.1 with default policy
# If more than one service project name is necessary, then you may need to # If more than one service project name is necessary, then you may need to
# override Ironic 'service_role' policy. # override Ironic 'service_role' policy.
ironic_service_role_elevated_access: True ironic_service_role_elevated_access: true
# The name of the entry in container_networks for the bmaas network # The name of the entry in container_networks for the bmaas network
# This is the default provisioning / inspection / cleaning network for this role # This is the default provisioning / inspection / cleaning network for this role
@ -158,7 +158,7 @@ ironic_bmaas_interface: >-
# http_url to be configured in the [deploy] section of the # http_url to be configured in the [deploy] section of the
# config file. If this is set to False, then Ironic will use # config file. If this is set to False, then Ironic will use
# Swift to host the floppy images and generated boot_iso. # Swift to host the floppy images and generated boot_iso.
ironic_enable_web_server_for_images: False ironic_enable_web_server_for_images: false
ironic_http_bind_address: "{{ ironic_bmaas_address }}" ironic_http_bind_address: "{{ ironic_bmaas_address }}"
ironic_http_url: "{{ ironic_ipxe_proto }}://{{ ironic_http_bind_address }}:{{ ironic_ipxe_port }}" ironic_http_url: "{{ ironic_ipxe_proto }}://{{ ironic_http_bind_address }}:{{ ironic_ipxe_port }}"
ironic_http_root: "/httpboot" ironic_http_root: "/httpboot"
@ -177,7 +177,7 @@ ironic_swift_url_endpoint_type: swift
# Is this Ironic installation working standalone? # Is this Ironic installation working standalone?
# If you're wanting Ironic to work without being integrated to other OpenStack # If you're wanting Ironic to work without being integrated to other OpenStack
# services, set this to True, and update the dhcp configuration appropriately # services, set this to True, and update the dhcp configuration appropriately
ironic_standalone: False ironic_standalone: false
# Enables or disables automated cleaning. Automated cleaning # Enables or disables automated cleaning. Automated cleaning
# is a configurable set of steps, such as erasing disk drives, # is a configurable set of steps, such as erasing disk drives,
@ -423,7 +423,7 @@ ironic_inspector_db_connection_recycle_time: "{{ openstack_db_connection_recycle
ironic_inspector_pip_install_args: "{{ pip_install_options | default('') }}" ironic_inspector_pip_install_args: "{{ pip_install_options | default('') }}"
# Ironic iPXE support # Ironic iPXE support
ironic_ipxe_enabled: False ironic_ipxe_enabled: false
ironic_ipxe_port: 8051 ironic_ipxe_port: 8051
ironic_ipxe_proto: "http" ironic_ipxe_proto: "http"
@ -438,7 +438,7 @@ ironic_inspector_swift_role_names:
- swiftoperator - swiftoperator
# Ironic deploy images need to be uploaded to glance. # Ironic deploy images need to be uploaded to glance.
ironic_deploy_image_glance_upload: True ironic_deploy_image_glance_upload: true
# Set the directory where the downloaded image will be stored # Set the directory where the downloaded image will be stored
# on the ironic_service_setup_host host. If the host is localhost, # on the ironic_service_setup_host host. If the host is localhost,
@ -456,20 +456,20 @@ ironic_deploy_image_initramfs_name: "{{ ironic_deploy_image_base_name + '.initra
ironic_deploy_image_list: ironic_deploy_image_list:
- url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_kernel_name }}" - url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_kernel_name }}"
sha_url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_kernel_name ~ '.sha256' }}" sha_url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_kernel_name ~ '.sha256' }}"
container_format: 'bare' container_format: "bare"
disk_format: 'raw' disk_format: "raw"
name: "{{ ironic_deploy_image_kernel_name }}" name: "{{ ironic_deploy_image_kernel_name }}"
- url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_initramfs_name }}" - url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_initramfs_name }}"
sha_url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_initramfs_name ~ '.sha256' }}" sha_url: "{{ ironic_deploy_image_server ~ ironic_deploy_image_server_path ~ ironic_deploy_image_initramfs_name ~ '.sha256' }}"
container_format: 'bare' container_format: "bare"
disk_format: 'raw' disk_format: "raw"
name: "{{ ironic_deploy_image_initramfs_name }}" name: "{{ ironic_deploy_image_initramfs_name }}"
# allow user defined extra images to upload # allow user defined extra images to upload
ironic_extra_deploy_image_list: [] ironic_extra_deploy_image_list: []
# Ironic inspector # Ironic inspector
ironic_inspector_enable_discovery: True ironic_inspector_enable_discovery: true
ironic_inspector_openstack_db_connection_string: >- ironic_inspector_openstack_db_connection_string: >-
mysql+pymysql://{{ ironic_inspector_galera_user }}:{{ ironic_inspector_container_mysql_password }}@{{ ironic_inspector_galera_address -}}:{{ mysql+pymysql://{{ ironic_inspector_galera_user }}:{{ ironic_inspector_container_mysql_password }}@{{ ironic_inspector_galera_address -}}:{{
ironic_inspector_galera_port }}/{{ ironic_inspector_galera_database }}?charset=utf8{% ironic_inspector_galera_port }}/{{ ironic_inspector_galera_database }}?charset=utf8{%
@ -481,16 +481,16 @@ ironic_inspector_openstack_db_connection_string: >-
# ironic_inspector_processing_hooks: "$default_processing_hooks,lldp_basic,local_link_connection" # ironic_inspector_processing_hooks: "$default_processing_hooks,lldp_basic,local_link_connection"
# pass additional kernel paramters to the deploy image # pass additional kernel paramters to the deploy image
ironic_inspector_extra_callback_parameters: '' ironic_inspector_extra_callback_parameters: ""
# Ironic inspector dhcp # Ironic inspector dhcp
ironic_inspector_dhcp_address: "{{ ironic_bmaas_address }}" ironic_inspector_dhcp_address: "{{ ironic_bmaas_address }}"
ironic_inspector_dhcp_pool_range: 192.168.0.51 192.168.0.150 ironic_inspector_dhcp_pool_range: 192.168.0.51 192.168.0.150
ironic_inspector_dhcp_subnet: 192.168.0.0/22 ironic_inspector_dhcp_subnet: 192.168.0.0/22
ironic_inspector_dhcp_subnet_mask: 255.255.252.0 ironic_inspector_dhcp_subnet_mask: 255.255.252.0
ironic_insepctor_dhcp_enable_gateway: True ironic_insepctor_dhcp_enable_gateway: true
ironic_inspector_dhcp_gateway: 192.168.0.1 ironic_inspector_dhcp_gateway: 192.168.0.1
ironic_inspector_dhcp_enable_nameservers: True ironic_inspector_dhcp_enable_nameservers: true
ironic_inspector_dhcp_nameservers: 192.168.0.1 ironic_inspector_dhcp_nameservers: 192.168.0.1
ironic_inspector_dhcp_lease_time: 600 ironic_inspector_dhcp_lease_time: 600
@ -543,7 +543,7 @@ ironic_pki_setup_host: "{{ openstack_pki_setup_host | default('localhost') }}"
ironic_pki_keys_path: "{{ ironic_pki_dir ~ '/certs/private/' }}" ironic_pki_keys_path: "{{ ironic_pki_dir ~ '/certs/private/' }}"
ironic_pki_certs_path: "{{ ironic_pki_dir ~ '/certs/certs/' }}" ironic_pki_certs_path: "{{ ironic_pki_dir ~ '/certs/certs/' }}"
ironic_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}" ironic_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}"
ironic_pki_regen_cert: '' ironic_pki_regen_cert: ""
ironic_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}" ironic_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}"
ironic_pki_certificates: ironic_pki_certificates:
- name: "ironic_{{ ansible_facts['hostname'] }}" - name: "ironic_{{ ansible_facts['hostname'] }}"

View File

@ -17,8 +17,8 @@
service: service:
name: "{{ item.service_name }}" name: "{{ item.service_name }}"
state: restarted state: restarted
enabled: yes enabled: true
daemon_reload: yes daemon_reload: true
with_list: "{{ filtered_ironic_services }}" with_list: "{{ filtered_ironic_services }}"
listen: listen:
- "venv changed" - "venv changed"
@ -29,8 +29,8 @@
service: service:
name: "{{ ironic_tftpd_service_name }}" name: "{{ ironic_tftpd_service_name }}"
state: restarted state: restarted
enabled: yes enabled: true
daemon_reload: yes daemon_reload: true
failed_when: false failed_when: false
- name: Restart isc-dhcp-server - name: Restart isc-dhcp-server
@ -48,9 +48,9 @@
- name: Restart web server - name: Restart web server
service: service:
name: "nginx" name: "nginx"
enabled: yes enabled: true
state: restarted state: restarted
daemon_reload: yes daemon_reload: true
register: _restart register: _restart
until: _restart is success until: _restart is success
retries: 5 retries: 5

View File

@ -52,7 +52,7 @@
copy: copy:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ ironic_tftpd_root }}/" dest: "{{ ironic_tftpd_root }}/"
remote_src: True remote_src: true
mode: "0644" mode: "0644"
with_items: "{{ ironic_library_modules_paths }}" with_items: "{{ ironic_library_modules_paths }}"
@ -60,7 +60,7 @@
file: file:
path: "{{ ironic_grub_dir }}" path: "{{ ironic_grub_dir }}"
state: directory state: directory
recurse: yes recurse: true
- name: Copy PXE grub config into tftpboot - name: Copy PXE grub config into tftpboot
copy: copy:
@ -74,7 +74,7 @@
copy: copy:
src: "{{ item.path }}" src: "{{ item.path }}"
dest: "{{ ironic_tftpd_root }}/{{ item.name }}" dest: "{{ ironic_tftpd_root }}/{{ item.name }}"
remote_src: True remote_src: true
mode: "0644" mode: "0644"
with_items: "{{ (ironic_uefi_modules + ironic_tftp_extra_content) | selectattr('path', 'defined') | list }}" with_items: "{{ (ironic_uefi_modules + ironic_tftp_extra_content) | selectattr('path', 'defined') | list }}"
@ -139,8 +139,8 @@
systemd_overrides: systemd_overrides:
Service: Service:
ExecStart: ExecStart:
- '' - ""
- '/usr/sbin/nginx -c /etc/nginx/nginx-nodefault.conf' - "/usr/sbin/nginx -c /etc/nginx/nginx-nodefault.conf"
notify: notify:
- Restart web server - Restart web server

View File

@ -15,14 +15,14 @@
- name: Update database schema - name: Update database schema
command: "{{ ironic_bin }}/ironic-dbsync upgrade" command: "{{ ironic_bin }}/ironic-dbsync upgrade"
become: yes become: true
become_user: "{{ ironic_system_user_name }}" become_user: "{{ ironic_system_user_name }}"
changed_when: false changed_when: false
when: inventory_hostname in groups['ironic_conductor'][0] when: inventory_hostname in groups['ironic_conductor'][0]
- name: Update database schema - name: Update database schema
command: "{{ ironic_bin }}/ironic-inspector-dbsync --config-file /etc/ironic-inspector/ironic-inspector.conf upgrade" command: "{{ ironic_bin }}/ironic-inspector-dbsync --config-file /etc/ironic-inspector/ironic-inspector.conf upgrade"
become: yes become: true
changed_when: false changed_when: false
when: when:
- _ironic_inspector_is_first_play_host - _ironic_inspector_is_first_play_host

View File

@ -34,13 +34,12 @@
checksum: "sha256:{{ item.sha_url }}" checksum: "sha256:{{ item.sha_url }}"
owner: "{{ ironic_system_user_name }}" owner: "{{ ironic_system_user_name }}"
group: "{{ ironic_system_group_name }}" group: "{{ ironic_system_group_name }}"
mode: '0644' mode: "0644"
with_items: "{{ ironic_deploy_image_list }}" with_items: "{{ ironic_deploy_image_list }}"
- name: Configure nginx when inspector boot mode is http - name: Configure nginx when inspector boot mode is http
when: ironic_inspector_boot_mode == 'http' when: ironic_inspector_boot_mode == 'http'
block: block:
- name: Disable default nginx configuration - name: Disable default nginx configuration
file: file:
path: /etc/nginx/sites-enabled/default path: /etc/nginx/sites-enabled/default
@ -86,8 +85,8 @@
systemd_overrides: systemd_overrides:
Service: Service:
ExecStart: ExecStart:
- '' - ""
- '/usr/sbin/nginx -c /etc/nginx/nginx-nodefault.conf' - "/usr/sbin/nginx -c /etc/nginx/nginx-nodefault.conf"
notify: notify:
- Restart web server - Restart web server