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 #
######################
._*
.ansible
.tox
*.egg-info
.eggs

View File

@ -16,7 +16,7 @@
# Defaults file for openstack-ansible-ironic
# Verbosity Options
debug: False
debug: false
# python venv executable
ironic_venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}"
@ -66,7 +66,7 @@ ironic_services:
group: ironic_api
service_name: ironic-api
init_config_overrides: "{{ ironic_api_init_config_overrides }}"
wsgi_app: True
wsgi_app: true
wsgi_name: ironic-api-wsgi
uwsgi_overrides: "{{ ironic_api_uwsgi_ini_overrides }}"
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
# If more than one service project name is necessary, then you may need to
# 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
# 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
# config file. If this is set to False, then Ironic will use
# 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_url: "{{ ironic_ipxe_proto }}://{{ ironic_http_bind_address }}:{{ ironic_ipxe_port }}"
ironic_http_root: "/httpboot"
@ -177,7 +177,7 @@ ironic_swift_url_endpoint_type: swift
# Is this Ironic installation working standalone?
# If you're wanting Ironic to work without being integrated to other OpenStack
# services, set this to True, and update the dhcp configuration appropriately
ironic_standalone: False
ironic_standalone: false
# Enables or disables automated cleaning. Automated cleaning
# 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 iPXE support
ironic_ipxe_enabled: False
ironic_ipxe_enabled: false
ironic_ipxe_port: 8051
ironic_ipxe_proto: "http"
@ -438,7 +438,7 @@ ironic_inspector_swift_role_names:
- swiftoperator
# 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
# 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:
- 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' }}"
container_format: 'bare'
disk_format: 'raw'
container_format: "bare"
disk_format: "raw"
name: "{{ ironic_deploy_image_kernel_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' }}"
container_format: 'bare'
disk_format: 'raw'
container_format: "bare"
disk_format: "raw"
name: "{{ ironic_deploy_image_initramfs_name }}"
# allow user defined extra images to upload
ironic_extra_deploy_image_list: []
# Ironic inspector
ironic_inspector_enable_discovery: True
ironic_inspector_enable_discovery: true
ironic_inspector_openstack_db_connection_string: >-
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{%
@ -481,16 +481,16 @@ ironic_inspector_openstack_db_connection_string: >-
# ironic_inspector_processing_hooks: "$default_processing_hooks,lldp_basic,local_link_connection"
# pass additional kernel paramters to the deploy image
ironic_inspector_extra_callback_parameters: ''
ironic_inspector_extra_callback_parameters: ""
# Ironic inspector dhcp
ironic_inspector_dhcp_address: "{{ ironic_bmaas_address }}"
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_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_enable_nameservers: True
ironic_inspector_dhcp_enable_nameservers: true
ironic_inspector_dhcp_nameservers: 192.168.0.1
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_certs_path: "{{ ironic_pki_dir ~ '/certs/certs/' }}"
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_certificates:
- name: "ironic_{{ ansible_facts['hostname'] }}"

View File

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

View File

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

View File

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

View File

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

View File

@ -15,12 +15,12 @@
- name: Post swift tempURL secret key
command: >
{{ ironic_bin }}/swift {{ keystone_service_adminuri_insecure | bool | ternary('--insecure', '--os-cacert ' ~ _ironic_ssl_truststore_location) }}
--os-username "service:{{ glance_service_user_name }}"
--os-password "{{ glance_service_password }}"
--os-auth-url {{ keystone_service_internalurl }}
--os-identity-api-version {{ keystone_service_internalurl.split('/v')[-1] }}
post -m temp-url-key:{{ ironic_swift_temp_url_secret_key }}
{{ ironic_bin }}/swift {{ keystone_service_adminuri_insecure | bool | ternary('--insecure', '--os-cacert ' ~ _ironic_ssl_truststore_location) }}
--os-username "service:{{ glance_service_user_name }}"
--os-password "{{ glance_service_password }}"
--os-auth-url {{ keystone_service_internalurl }}
--os-identity-api-version {{ keystone_service_internalurl.split('/v')[-1] }}
post -m temp-url-key:{{ ironic_swift_temp_url_secret_key }}
environment:
OS_ENDPOINT_TYPE: internalURL
changed_when: false
@ -33,12 +33,12 @@
- name: Get swift account
shell: >
{{ ironic_bin }}/swift {{ keystone_service_adminuri_insecure | bool | ternary('--insecure', '--os-cacert ' ~ _ironic_ssl_truststore_location) }}
--os-username "service:{{ glance_service_user_name }}"
--os-password "{{ glance_service_password }}"
--os-auth-url {{ keystone_service_internalurl }}
--os-identity-api-version {{ keystone_service_internalurl.split('/v')[-1] }}
stat -v | awk '/StorageURL\:/ {print $2}'
{{ ironic_bin }}/swift {{ keystone_service_adminuri_insecure | bool | ternary('--insecure', '--os-cacert ' ~ _ironic_ssl_truststore_location) }}
--os-username "service:{{ glance_service_user_name }}"
--os-password "{{ glance_service_password }}"
--os-auth-url {{ keystone_service_internalurl }}
--os-identity-api-version {{ keystone_service_internalurl.split('/v')[-1] }}
stat -v | awk '/StorageURL\:/ {print $2}'
environment:
OS_ENDPOINT_TYPE: internalURL
changed_when: false