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: I173a7f009412285c1d15f05b76b4ff24fb2b67ad
This commit is contained in:
Dmitriy Rabotyagov 2025-02-12 14:48:48 +01:00
parent 98f1244ca5
commit 8a252a7d2d
9 changed files with 32 additions and 32 deletions

1
.gitignore vendored
View File

@ -45,6 +45,7 @@ logs/*
# OS generated files #
######################
._*
.ansible
.tox
*.egg-info
.eggs

View File

@ -17,7 +17,7 @@
swift_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}"
## Verbosity Options
debug: False
debug: false
# Set the host which will execute the shade modules
# for the service setup. The host must already have
@ -55,7 +55,6 @@ swift_bin: "{{ _swift_bin }}"
# Set the full path to the swift recon cron
recon_cron_path: "{{ swift_bin }}/swift-recon-cron"
## Swift User / Group
swift_system_user_name: swift
swift_system_group_name: swift
@ -161,12 +160,12 @@ swift_dispersion_user: dispersion
swift_dispersion_user_domain_name: "Default"
swift_operator_role: swiftoperator
swift_allow_versions: True
swift_allow_versions: true
# This will allow all users to create containers and upload to swift if set to True
swift_allow_all_users: False
swift_allow_all_users: false
# If you want to regenerate the swift keys, on a run, for rsync purposes set this var to True
# otherwise keys will be generated on the first run and not regenerated each run.
swift_recreate_keys: False
swift_recreate_keys: false
swift_sorting_method: shuffle
# Set the fallocate_reserve value which will reserve space and fail on PUTs above this value in bytes (Default 10GB)
swift_fallocate_reserve: "1%"
@ -181,7 +180,7 @@ swift_object_disable_fallocate: "{{ swift_disable_fallocate }}"
# This variable will protect against changing swift_hash_path_* variables unintentionally.
# If you wish to change them intentionally set the swift_force_change_hashes variable to True.
swift_force_change_hashes: False
swift_force_change_hashes: false
## Swift ceilometer variables
swift_reselleradmin_role: ResellerAdmin
@ -262,7 +261,7 @@ swift_proxy_server_workers: "{{ (inventory_hostname == physical_host) | ternary(
# This var is calculated by the play itself, and should not need to be set
# It is defaulted for the benefit of the swift_proxy host which needs it
# for the swift-init-systemd.j2 template file.
swift_dedicated_replication: False
swift_dedicated_replication: false
swift_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
@ -294,10 +293,10 @@ swift_container_max_rsync_connections: "{{ swift_max_rsync_connections }}"
swift_object_max_rsync_connections: "{{ swift_max_rsync_connections }}"
# Set Swift to use rsync module per object server drive
swift_rsync_module_per_drive: False
swift_rsync_module_per_drive: false
# Set Swift to use reverse lookup - requires name resolution or hosts entries
swift_rsync_reverse_lookup: False
swift_rsync_reverse_lookup: false
# Set the managed regions as a list of swift regions to manage
# Use for global clusters, default when not set is all regions.
@ -309,8 +308,8 @@ swift_rsync_reverse_lookup: False
# role get run. You should never need to adjust these, they are set
# within the swift-setup and swift-sync roles to ensure only the
# appropriate tasks within the os-swift role are run.
swift_do_setup: True
swift_do_sync: True
swift_do_setup: true
swift_do_sync: true
# Example swift_container_sync_realms to specify container_sync realms
# This can exist for multiple realms (in a list)
@ -526,7 +525,7 @@ swift_services:
# If you run the swift playbook with this option enabled, before a swift
# replication pass completes, you may introduce unavailability in your
# cluster. This has an end-user impact.
swift_pretend_min_part_hours_passed: False
swift_pretend_min_part_hours_passed: false
# Set this option to enable or disable the pypy interpreter for swift
swift_pypy_enabled: false
@ -567,7 +566,7 @@ swift_memcache_conf_overrides: {}
# `openstack_service_backend_ssl` is not taken into account
# because TLS in swift-proxy is only for testing purposes:
# https://opendev.org/openstack/swift/src/commit/c78a5962b5f6c9e75f154cac924a226815236e98/etc/proxy-server.conf-sample
swift_backend_ssl: False
swift_backend_ssl: false
# Storage location for SSL certificate authority
swift_pki_dir: "{{ openstack_pki_dir | default('/etc/openstack_deploy/pki') }}"
@ -579,7 +578,7 @@ swift_pki_setup_host: "{{ openstack_pki_setup_host | default('localhost') }}"
swift_pki_keys_path: "{{ swift_pki_dir ~ '/certs/private/' }}"
swift_pki_certs_path: "{{ swift_pki_dir ~ '/certs/certs/' }}"
swift_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ExampleCorpIntermediate') }}"
swift_pki_regen_cert: ''
swift_pki_regen_cert: ""
swift_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}"
swift_pki_certificates:
- name: "swift_{{ ansible_facts['hostname'] }}"

View File

@ -16,9 +16,9 @@
- name: Restart swift services
service:
name: "{{ item.service_name }}"
enabled: yes
enabled: true
state: "restarted"
daemon_reload: yes
daemon_reload: true
with_items: "{{ filtered_swift_services }}"
listen:
- "venv changed"

View File

@ -42,9 +42,9 @@
systemd:
name: "{{ swift_sshd }}"
state: started
enabled: yes
masked: no
daemon_reload: yes
enabled: true
masked: false
daemon_reload: true
delegate_to: "{{ item }}"
with_items: "{{ groups['swift_proxy'] }}"
when:

View File

@ -18,7 +18,7 @@
url: "{{ swift_pypy_archive['url'] }}"
checksum: "{{ swift_pypy_archive['checksum'] }}"
dest: "/var/cache/{{ swift_pypy_archive['url'] | basename }}"
force: yes
force: true
mode: "0644"
- name: Create pypy dir
@ -47,7 +47,7 @@
- name: Check for pypy venv
stat:
path: "{{ swift_bin | dirname }}/{{ swift_pypy_version }}-inuse"
get_checksum: False
get_checksum: false
register: local_pypy_venv_stat
- name: Remove existing venv if not pypy setup

View File

@ -43,7 +43,7 @@
mode: "0640"
with_nested:
- "{{ swift.storage_policies }}"
- [{ type: 'object', port: "{{ swift_object_port }}" }]
- [{ type: "object", port: "{{ swift_object_port }}" }]
- name: Ensure swift config directory permissions
file:
@ -51,7 +51,7 @@
state: directory
owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}"
recurse: yes
recurse: true
when: swift_install_method == 'distro'
- name: "Build rings for account/container from contents files"
@ -59,10 +59,10 @@
/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }}{% endif %}{{
(swift_pretend_min_part_hours_passed | bool) | ternary(' -p', '') }}
with_nested:
- ['account', 'container']
- ["account", "container"]
- "{{ swift_managed_regions | default([None]) }}"
register: swift_rings_create
become: yes
become: true
become_user: "{{ swift_system_user_name }}"
changed_when: "swift_rings_create.rc not in [1, 2, 3]"
failed_when: "swift_rings_create.rc in [1, 2]"
@ -77,7 +77,7 @@
- "{{ swift.storage_policies }}"
- "{{ swift_managed_regions | default([None]) }}"
register: swift_object_rings_create
become: yes
become: true
become_user: "{{ swift_system_user_name }}"
changed_when: "swift_object_rings_create.rc not in [1, 2, 3]"
failed_when: "swift_object_rings_create.rc in [1, 2]"

View File

@ -21,4 +21,4 @@
- name: Register a fact for the md5sum
set_fact:
builder_md5sum: "{{ md5sum.stdout }}"
builder_md5sum: "{{ md5sum.stdout }}"

View File

@ -43,9 +43,9 @@
command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}"
changed_when: false
with_nested:
- ['account', 'container']
- ["account", "container"]
- "{{ swift_managed_regions | default([None]) }}"
become: yes
become: true
become_user: "{{ swift_system_user_name }}"
args:
chdir: /etc/swift/ring_build_files/
@ -57,7 +57,7 @@
with_nested:
- "{{ swift.storage_policies }}"
- "{{ swift_managed_regions | default([None]) }}"
become: yes
become: true
become_user: "{{ swift_system_user_name }}"
args:
chdir: /etc/swift/ring_build_files/

View File

@ -23,7 +23,7 @@
name: "net.ipv4.tcp_tw_reuse"
state: present
value: "1"
sysctl_set: yes
sysctl_set: true
sysctl_file: "{{ swift_sysctl_file }}"
delegate_to: "{{ physical_host }}"
@ -32,7 +32,7 @@
name: "fs.file-max"
state: present
value: "{{ swift_max_file_limits }}"
sysctl_set: yes
sysctl_set: true
sysctl_file: "{{ swift_sysctl_file }}"
delegate_to: "{{ physical_host }}"