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: I2773d3465665bfe95516ca8f34fc8351b1e8c18f
This commit is contained in:
Dmitriy Rabotyagov 2025-02-13 09:57:12 +01:00
parent 018139f0cd
commit 3fa0c33ed3
20 changed files with 83 additions and 86 deletions

1
.gitignore vendored
View File

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

View File

@ -40,9 +40,11 @@ ceph_client_package_state: "{{ package_state | default('latest') }}"
# package repositories.
ceph_pkg_source: ceph
ceph_stable_release: reef
ceph_apt_pinned_packages: [{package: "*", release: "ceph.com", priority: 1001}]
ceph_repo_url_region: "download" # see here for other mirros http://docs.ceph.com/docs/master/install/mirrors/
ceph_apt_pinned_packages:
- package: "*"
release: "ceph.com"
priority: 1001
ceph_repo_url_region: "download" # see here for other mirros http://docs.ceph.com/docs/master/install/mirrors/
ceph_repo_url: https://{{ ceph_repo_url_region }}.ceph.com/{{ _ceph_repo_distro_suffix }}-{{ ceph_stable_release }}
ceph_repos: "{{ _ceph_repos }}"
@ -99,14 +101,14 @@ immutable_object_cache_client: immutable-object-cache
# needs to access both volumes (cinder) as boot disks (nova) we default to
# reuse the cinder_ceph_client
# only need to change this if you'd use ceph for boot disks and not for volumes
nova_ceph_client: '{{ cinder_ceph_client }}'
nova_ceph_client: "{{ cinder_ceph_client }}"
# overruled in user_secrets:
# nova_ceph_client_uuid:
cephkeys_access_group: ceph
openstack_service_system_user: null
openstack_service_system_user:
ceph_cinder_service_names:
- cinder-volume
@ -141,7 +143,7 @@ ceph_centos_epel_key: >-
{{ centos_epel_key | default('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-' ~ ansible_facts['distribution_major_version']) }}
# Immutible object cache - caches a read-only base layer of rbd volumes
ceph_immutable_object_cache_enabled: False
ceph_immutable_object_cache_enabled: false
ceph_immutable_object_cache_service_name: "ceph-immutable-object-cache@"
ceph_immutable_object_cache_dir: "/ceph-immutable-object-cache"
ceph_immutable_object_cache_socket: "/run/ceph/immutable_object_cache_sock"
@ -152,7 +154,7 @@ ceph_immutable_object_cache_mode: "0775"
ceph_immutable_object_cache_key_owner: "{{ ceph_immutable_object_cache_owner }}"
ceph_immutable_object_cache_key_group: "{{ ceph_immutable_object_cache_group }}"
ceph_persistent_write_log_cache_enabled: False
ceph_persistent_write_log_cache_enabled: false
ceph_persistent_write_log_cache_dir: "/rbd-write-log-cache"
ceph_persistent_write_log_cache_owner: "libvirt-qemu"
ceph_persistent_write_log_cache_group: "ceph"

View File

@ -1,3 +1,4 @@
---
- name: Install Ceph client
hosts: all
user: root

View File

@ -1,3 +1,4 @@
---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -29,7 +29,7 @@
user:
name: "{{ openstack_service_system_user }}"
groups: "{{ cephkeys_access_group }}"
append: yes
append: true
notify:
- Restart os services
@ -111,7 +111,7 @@
- name: Detect correct group for extra auth
set_fact:
ceph_in_extra_auth_group: True
ceph_in_extra_auth_group: true
with_items: "{{ ceph_extra_auth_groups }}"
when:
- ceph_extra_confs is defined
@ -125,7 +125,7 @@
- name: Detect extra nova uuid secret
set_fact:
ceph_extra_nova_uuid: True
ceph_extra_nova_uuid: true
with_items: "{{ ceph_extra_confs | default([]) }}"
when:
- inventory_hostname in groups[ceph_extra_compute_group]

View File

@ -12,8 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create keyring files for openstack clients from extra cluster(s)
shell: >-
ceph auth get client.{{ item.client_name }} --cluster {{ ceph_cluster_name }} >/dev/null &&

View File

@ -12,8 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create key files for nova_compute on extra cluster(s)
shell: >-
ceph auth get-key client.{{ item.client_name }} --cluster {{ ceph_cluster_name }}

View File

@ -25,7 +25,7 @@
slurp:
src: "/etc/ceph/{{ ceph_cluster_name }}.conf"
register: ceph_conf_content_mon
delegate_to: '{{ ceph_mon_host }}'
delegate_to: "{{ ceph_mon_host }}"
changed_when: false
when:
- ceph_conf_file is not defined
@ -44,19 +44,19 @@
- name: Create ceph.conf from mon host
openstack.config_template.config_template:
content: '{{ ceph_conf }}'
content: "{{ ceph_conf }}"
dest: "/etc/ceph/{{ ceph_cluster_name }}.conf"
owner: root
group: root
mode: "0644"
config_type: ini
config_overrides: '{{ ceph_client_ceph_conf_overrides }}'
config_overrides: "{{ ceph_client_ceph_conf_overrides }}"
notify:
- Restart os services
- name: Detect correct group for extra config
set_fact:
ceph_in_extra_config_group: True
ceph_in_extra_config_group: true
when:
- ceph_extra_confs is defined
- inventory_hostname in groups[item]

View File

@ -12,8 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Get extra ceph.conf files
command: "scp {{ item.mon_host }}:/etc/ceph/{{ item.cluster_name | default(ceph_cluster_name) }}.conf {{ item.src }}"
changed_when: false

View File

@ -27,7 +27,7 @@
{% endfor %}
{{ _keys }}
changed_when: false
delegate_facts: False
delegate_facts: false
delegate_to: localhost
tags:
- ceph-config

View File

@ -25,7 +25,7 @@
ceph auth get-or-create client.{{ item['name'] }} --cluster {{ ceph_cluster_name }}
with_items: "{{ ceph_client_filtered_clients }}"
changed_when: false
delegate_to: '{{ ceph_mon_host }}'
delegate_to: "{{ ceph_mon_host }}"
register: ceph_client_keyrings
until: ceph_client_keyrings is success
retries: 3
@ -63,7 +63,7 @@
- inventory_hostname in groups.nova_compute
- nova_ceph_client in ceph_client_filtered_clients | map(attribute='name') | list
changed_when: false
delegate_to: '{{ ceph_mon_host }}'
delegate_to: "{{ ceph_mon_host }}"
register: ceph_nova_secret
tags:
- always

View File

@ -26,7 +26,7 @@
- name: Set ceph_mon_host to an online monitor host
set_fact:
ceph_mon_host: '{{ item.item }}'
ceph_mon_host: "{{ item.item }}"
when:
- item is success
# Use the first available monitor

View File

@ -1,3 +1,4 @@
---
# Copyright 2023, BBC R&D
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -15,7 +15,7 @@
- name: Install ceph packages
package:
name: '{{ ceph_client_filtered_packages }}'
name: "{{ ceph_client_filtered_packages }}"
state: "{{ ceph_client_package_state }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
cache_valid_time: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}"

View File

@ -18,7 +18,7 @@
paths: "{{ openstack_service_venv_bin | dirname }}/lib/"
patterns: "python*"
file_type: directory
recurse: no
recurse: false
register: python_venv_details
- name: Set python venvs details

View File

@ -77,7 +77,7 @@
- name: Update Apt cache
apt:
update_cache: yes
update_cache: true
when: (apt_repo_removed is changed) or (deb822_repos is changed)
register: update_apt_cache
until: update_apt_cache is success

View File

@ -113,13 +113,13 @@
- name: Write AppArmor configuration for ceph immutable object caching
ansible.builtin.blockinfile:
create: True
create: true
mode: "0644"
path: /etc/apparmor.d/local/abstractions/libvirt-qemu
marker: "### {mark} OSA CEPH_CLIENT IMMUTABLE OBJECT CACHE BLOCK ###"
block: |
{{ ceph_immutable_object_cache_dir }}/** r,
{{ ceph_immutable_object_cache_socket }} rw,
{{ ceph_immutable_object_cache_dir }}/** r,
{{ ceph_immutable_object_cache_socket }} rw,
state: "{{ ceph_immutable_object_cache_enabled | bool | ternary('present', 'absent') }}"
when:
- ansible_facts['os_family'] == "Debian"
@ -139,12 +139,12 @@
- name: Write AppArmor configuration for ceph write log caching
ansible.builtin.blockinfile:
create: True
create: true
mode: "0644"
path: /etc/apparmor.d/local/abstractions/libvirt-qemu
marker: "### {mark} OSA CEPH_CLIENT WRITE LOG CACHE BLOCK ###"
block: |
{{ ceph_persistent_write_log_cache_dir }}/** rwk,
{{ ceph_persistent_write_log_cache_dir }}/** rwk,
state: "{{ ceph_persistent_write_log_cache_enabled | bool | ternary('present', 'absent') }}"
when:
- ansible_facts['os_family'] == "Debian"

View File

@ -17,7 +17,6 @@
## APT Cache Options
cache_timeout: 600
libvirt_packages:
- libvirt-daemon-system

View File

@ -12,26 +12,24 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# http://ceph.com/docs/master/rbd/rbd-openstack/
ceph_components:
- component: glance_api
package: "{{ python_ceph_packages }}"
client:
- name: '{{ glance_ceph_client }}'
service: '{{ ceph_glance_service_names }}'
- name: "{{ glance_ceph_client }}"
service: "{{ ceph_glance_service_names }}"
- component: cinder_volume
package: "{{ ['ceph-common'] + python_ceph_packages }}"
client:
- name: '{{ cinder_ceph_client }}'
service: '{{ ceph_cinder_service_names }}'
- name: "{{ cinder_ceph_client }}"
service: "{{ ceph_cinder_service_names }}"
- component: cinder_backup
package: "{{ ['ceph-common'] + python_ceph_packages }}"
client:
- name: '{{ cinder_backup_ceph_client }}'
service: '{{ ceph_cinder_service_names }}'
- name: "{{ cinder_backup_ceph_client }}"
service: "{{ ceph_cinder_service_names }}"
- component: nova_compute
package: "{{ (libvirt_packages + ['ceph-common'] + ceph_immutable_object_cache_packages + python_ceph_packages) | select }}"
client:
@ -40,7 +38,7 @@ ceph_components:
owner: "{{ ceph_immutable_object_cache_key_owner }}"
group: "{{ ceph_immutable_object_cache_key_group }}"
enabled: "{{ ceph_immutable_object_cache_enabled }}"
service: '{{ ceph_nova_service_names }}'
service: "{{ ceph_nova_service_names }}"
- component: manila_share
package: "{{ ['ceph-common'] + python_ceph_packages }}"
client:
@ -63,44 +61,44 @@ ceph_extra_components: []
# service: '{{ ceph_gnocchi_service_names }}'
ceph_client_filtered_packages: |-
{% set packages = [] %}
{% for comp in (ceph_components + ceph_extra_components) %}
{% if comp.component in group_names %}
{% for pkg_name in comp.package %}
{% if pkg_name not in packages %}
{% set _ = packages.append(pkg_name) %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{{ packages }}
{% set packages = [] %}
{% for comp in (ceph_components + ceph_extra_components) %}
{% if comp.component in group_names %}
{% for pkg_name in comp.package %}
{% if pkg_name not in packages %}
{% set _ = packages.append(pkg_name) %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{{ packages }}
ceph_client_filtered_services: |-
{% set services = [] %}
{% for comp in (ceph_components + ceph_extra_components) %}
{% if comp.component in group_names and 'service' in comp %}
{% set _ = services.append(comp.service) %}
{% endif %}
{% endfor %}
{{ services }}
{% set services = [] %}
{% for comp in (ceph_components + ceph_extra_components) %}
{% if comp.component in group_names and 'service' in comp %}
{% set _ = services.append(comp.service) %}
{% endif %}
{% endfor %}
{{ services }}
ceph_client_filtered_clients: |-
{% set clients = [] %}
{% for comp in (ceph_components + ceph_extra_components) %}
{% if comp.component in group_names %}
{% if ((comp.component != 'cinder_backup') or
((cinder_service_backup_program_enabled is defined and
cinder_service_backup_program_enabled | bool) and
(cinder_service_backup_driver is defined and
'ceph' in cinder_service_backup_driver))) %}
{% for client in comp.client %}
{% if client is not mapping %}
{% set _ = clients.append({'name': client}) %}
{% elif client['enabled'] | default(true) | bool %}
{% set _ = clients.append(client) %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{{ clients }}
{% set clients = [] %}
{% for comp in (ceph_components + ceph_extra_components) %}
{% if comp.component in group_names %}
{% if ((comp.component != 'cinder_backup') or
((cinder_service_backup_program_enabled is defined and
cinder_service_backup_program_enabled | bool) and
(cinder_service_backup_driver is defined and
'ceph' in cinder_service_backup_driver))) %}
{% for client in comp.client %}
{% if client is not mapping %}
{% set _ = clients.append({'name': client}) %}
{% elif client['enabled'] | default(true) | bool %}
{% set _ = clients.append(client) %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{{ clients }}

View File

@ -39,9 +39,9 @@ _ceph_repos:
- name: ceph-client-deps
baseurl: "{{ ceph_centos_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
gpgcheck: yes
gpgcheck: true
gpgkey: "file:///etc/pki/rpm-gpg/{{ ceph_centos_epel_key.split('/')[-1] }}"
enabled: yes
enabled: true
state: "{{ (ceph_pkg_source == 'ceph') | ternary('present', 'absent') }}"
includepkgs:
- fmt
@ -50,7 +50,7 @@ _ceph_repos:
- libarrow-doc
- libbabeltrace
- liboath
- 'lttng-ust*'
- "lttng-ust*"
- parquet-libs
- re2
- thrift
@ -59,16 +59,16 @@ _ceph_repos:
description: "Ceph packages for $basearch"
file: ceph
baseurl: "{{ ceph_repo_url }}/el$releasever/$basearch"
gpgcheck: yes
enabled: yes
gpgcheck: true
enabled: true
priority: 50
state: "{{ (ceph_pkg_source == 'ceph') | ternary('present', 'absent') }}"
- name: ceph-noarch
description: "Ceph noarch packages"
file: ceph
baseurl: "{{ ceph_repo_url }}/el$releasever/noarch"
gpgcheck: yes
enabled: yes
gpgcheck: true
enabled: true
priority: 50
state: "{{ (ceph_pkg_source == 'ceph') | ternary('present', 'absent') }}"