Fix linters and metadata

With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.

With that we also update metdata to reflect current state.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/888223
Change-Id: I9110294e492a501204c8e92448a2f2929781a509
This commit is contained in:
Dmitriy Rabotyagov 2023-07-14 18:49:03 +02:00
parent 93beaf8c4a
commit 6a25236b25
12 changed files with 82 additions and 45 deletions

View File

@ -21,7 +21,11 @@ manila_package_state: "{{ package_state | default('latest') }}"
# for the service setup. The host must already have # for the service setup. The host must already have
# clouds.yaml properly configured. # clouds.yaml properly configured.
manila_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" manila_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
manila_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((manila_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" manila_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(manila_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
# Set installation method. # Set installation method.
manila_install_method: "{{ service_install_method | default('source') }}" manila_install_method: "{{ service_install_method | default('source') }}"
@ -29,7 +33,8 @@ manila_venv_python_executable: "{{ openstack_venv_python_executable | default('p
manila_git_repo: https://opendev.org/openstack/manila manila_git_repo: https://opendev.org/openstack/manila
manila_git_install_branch: master manila_git_install_branch: master
manila_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" manila_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
manila_git_constraints: manila_git_constraints:
- "--constraint {{ manila_upper_constraints_url }}" - "--constraint {{ manila_upper_constraints_url }}"
@ -52,7 +57,11 @@ manila_fatal_deprecations: False
## Database info ## Database info
manila_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}" manila_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
manila_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((manila_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" manila_db_setup_python_interpreter: >-
{{
openstack_db_setup_python_interpreter | default(
(manila_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
manila_galera_address: "{{ galera_address | default('127.0.0.1') }}" manila_galera_address: "{{ galera_address | default('127.0.0.1') }}"
manila_galera_user: manila manila_galera_user: manila
manila_galera_database: manila manila_galera_database: manila
@ -175,7 +184,8 @@ manila_service_data_program_enabled: false
## Cap the maximun number of threads / workers when a user value is unspecified. ## Cap the maximun number of threads / workers when a user value is unspecified.
manila_osapi_share_workers_max: 16 manila_osapi_share_workers_max: 16
manila_osapi_share_workers: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, manila_osapi_share_workers_max] | min }}" manila_osapi_share_workers: >-
{{ [[(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2, manila_osapi_share_workers_max] | min }}
## Manila RPC ## Manila RPC
manila_rpc_executor_thread_pool_size: 64 manila_rpc_executor_thread_pool_size: 64
@ -214,12 +224,12 @@ manila_share_name_template: share-%s
# manila_backend_lvm_inuse: True if current host has an lvm backend # manila_backend_lvm_inuse: True if current host has an lvm backend
manila_backend_lvm_inuse: "{{ (manila_backends | to_json).find('lvm') != -1 }}" manila_backend_lvm_inuse: "{{ (manila_backends | to_json).find('lvm') != -1 }}"
# manila_backend_rbd_inuse: True if the current host has an rbd backend # manila_backend_rbd_inuse: True if the current host has an rbd backend
manila_backend_rbd_inuse: "{{ (manila_backends |to_json).find('manila.share.drivers.cephfs') != -1 }}" manila_backend_rbd_inuse: "{{ (manila_backends | to_json).find('manila.share.drivers.cephfs') != -1 }}"
## Policy vars ## Policy vars
# Provide a list of access controls to update the default policy.json with. These changes will be merged # Provide a list of access controls to update the default policy.json with. These changes will be merged
# with the access controls in the default policy.json. E.g. # with the access controls in the default policy.json. E.g.
#manila_policy_overrides: # manila_policy_overrides:
# "share:create": "" # "share:create": ""
# "share:delete": "" # "share:delete": ""
@ -286,10 +296,9 @@ manila_services:
uwsgi_bind_address: "{{ manila_uwsgi_bind_address }}" uwsgi_bind_address: "{{ manila_uwsgi_bind_address }}"
uwsgi_tls: "{{ manila_backend_ssl | ternary(manila_uwsgi_tls, {}) }}" uwsgi_tls: "{{ manila_backend_ssl | ternary(manila_uwsgi_tls, {}) }}"
#condition: "{{ manila_service_data_program_enabled | bool }}"
# Manila uWSGI settings # Manila uWSGI settings
manila_wsgi_processes_max: 16 manila_wsgi_processes_max: 16
manila_wsgi_processes: "{{ [[ansible_facts['processor_vcpus']|default(1), 1] | max * 2, manila_wsgi_processes_max] | min }}" manila_wsgi_processes: "{{ [[ansible_facts['processor_vcpus'] | default(1), 1] | max * 2, manila_wsgi_processes_max] | min }}"
manila_wsgi_threads: 1 manila_wsgi_threads: 1
manila_wsgi_buffer_size: 65535 manila_wsgi_buffer_size: 65535
manila_uwsgi_tls: manila_uwsgi_tls:
@ -356,5 +365,5 @@ manila_pki_install_certificates:
mode: "0600" mode: "0600"
# Define user-provided SSL certificates # Define user-provided SSL certificates
#manila_user_ssl_cert: <path to cert on ansible deployment host> # manila_user_ssl_cert: <path to cert on ansible deployment host>
#manila_user_ssl_key: <path to cert on ansible deployment host> # manila_user_ssl_key: <path to cert on ansible deployment host>

View File

@ -18,16 +18,18 @@ galaxy_info:
description: Installation and setup of manila description: Installation and setup of manila
company: Rackspace company: Rackspace
license: Apache2 license: Apache2
min_ansible_version: 2.4 role_name: os_manila
namespace: openstack
min_ansible_version: "2.10"
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- buster - bullseye
- name: Ubuntu - name: Ubuntu
versions: versions:
- bionic
- focal - focal
categories: - jammy
galaxy_tags:
- cloud - cloud
- python - python
- manila - manila

View File

@ -65,14 +65,16 @@
tags: tags:
- always - always
- import_tasks: manila_lvm_config.yml - name: Importing manila_lvm_config tasks
import_tasks: manila_lvm_config.yml
when: when:
- manila_services['manila-share']['group'] in group_names - manila_services['manila-share']['group'] in group_names
- manila_backend_lvm_inuse | bool - manila_backend_lvm_inuse | bool
tags: tags:
- manila-config - manila-config
- include_role: - name: Including osa.db_setup role
include_role:
name: openstack.osa.db_setup name: openstack.osa.db_setup
apply: apply:
tags: tags:
@ -93,7 +95,8 @@
tags: tags:
- always - always
- include_role: - name: Including osa.mq_setup role
include_role:
name: openstack.osa.mq_setup name: openstack.osa.mq_setup
apply: apply:
tags: tags:
@ -115,11 +118,13 @@
tags: tags:
- always - always
- import_tasks: manila_pre_install.yml - name: Importing manila_pre_install tasks
import_tasks: manila_pre_install.yml
tags: tags:
- manila-install - manila-install
- import_tasks: manila_install.yml - name: Importing manila_install tasks
import_tasks: manila_install.yml
tags: tags:
- manila-install - manila-install
@ -143,18 +148,21 @@
tags: tags:
- always - always
- import_tasks: manila_post_install.yml - name: Importing manila_post_install tasks
import_tasks: manila_post_install.yml
tags: tags:
- manila-config - manila-config
- import_tasks: manila_keys.yml - name: Importing manila_keys tasks
import_tasks: manila_keys.yml
when: when:
- manila_keypair_path is defined - manila_keypair_path is defined
- manila_services['manila-share']['group'] in group_names - manila_services['manila-share']['group'] in group_names
tags: tags:
- manila-config - manila-config
- include_tasks: manila_db_sync.yml - name: Including manila_db_sync tasks
include_tasks: manila_db_sync.yml
when: when:
- _manila_is_first_play_host - _manila_is_first_play_host
tags: tags:
@ -172,7 +180,7 @@
- manila-config - manila-config
- uwsgi - uwsgi
- name: import_tasks ceph_client role - name: Importing ceph_client role
import_role: import_role:
name: ceph_client name: ceph_client
vars: vars:
@ -184,7 +192,8 @@
tags: tags:
- ceph - ceph
- include_role: - name: Including osa.service_setup role
include_role:
name: openstack.osa.service_setup name: openstack.osa.service_setup
apply: apply:
tags: tags:
@ -224,7 +233,8 @@
tags: tags:
- manila-config - manila-config
- import_tasks: manila_backends.yml - name: Importing manila_backends tasks
import_tasks: manila_backends.yml
when: when:
- groups[manila_services['manila-share']['group']] | length > 0 - groups[manila_services['manila-share']['group']] | length > 0
- _manila_share_is_first_play_host - _manila_share_is_first_play_host

View File

@ -32,9 +32,12 @@
- name: Add in manila devices types - name: Add in manila devices types
shell: | shell: |
. {{ ansible_facts['env']['HOME'] }}/openrc . {{ ansible_facts['env']['HOME'] }}/openrc
CLI_OPTIONS="--os-interface internal {{ ((keystone_service_adminuri_insecure | bool) or (manila_service_internaluri_insecure | bool)) | ternary('--insecure','') }}" CLI_OPTIONS="--os-interface internal {{ ((keystone_service_adminuri_insecure | bool) or (manila_service_internaluri_insecure | bool)) | ternary(
'--insecure', '')
}}"
if ! openstack ${CLI_OPTIONS} share type list | grep -q "{{ item.key }}"; then if ! openstack ${CLI_OPTIONS} share type list | grep -q "{{ item.key }}"; then
openstack ${CLI_OPTIONS} share type create "{{ item.key }}" "{{ item.value.driver_handles_share_servers }}" --extra-specs "share_backend_name={{ item.value.share_backend_name }}" openstack ${CLI_OPTIONS} share type create "{{ item.key }}" "{{ item.value.driver_handles_share_servers }}" \
--extra-specs "share_backend_name={{ item.value.share_backend_name }}"
fi fi
args: args:
executable: /bin/bash executable: /bin/bash

View File

@ -35,6 +35,7 @@
section: manila section: manila
option: need_online_data_migrations option: need_online_data_migrations
value: false value: false
mode: "0644"
when: when:
- not data_migrations is skipped - not data_migrations is skipped
- data_migrations is succeeded - data_migrations is succeeded

View File

@ -19,6 +19,7 @@
section: "manila" section: "manila"
option: "install_method" option: "install_method"
value: "{{ manila_install_method }}" value: "{{ manila_install_method }}"
mode: "0644"
- name: Refresh local facts to ensure the manila section is present - name: Refresh local facts to ensure the manila section is present
setup: setup:
@ -64,10 +65,10 @@
systemd_tempd_prefix: openstack systemd_tempd_prefix: openstack
systemd_slice_name: "{{ manila_system_slice_name }}" systemd_slice_name: "{{ manila_system_slice_name }}"
systemd_lock_dir: "{{ manila_lock_dir }}" systemd_lock_dir: "{{ manila_lock_dir }}"
systemd_CPUAccounting: true systemd_service_cpu_accounting: true
systemd_BlockIOAccounting: true systemd_service_block_io_accounting: true
systemd_MemoryAccounting: true systemd_service_memory_accounting: true
systemd_TasksAccounting: true systemd_service_tasks_accounting: true
systemd_services: |- systemd_services: |-
{% set services = [] %} {% set services = [] %}
{% for service in filtered_manila_services %} {% for service in filtered_manila_services %}
@ -94,6 +95,7 @@
section: manila section: manila
option: "{{ item }}" option: "{{ item }}"
value: true value: true
mode: "0644"
with_items: with_items:
- "need_online_data_migrations" - "need_online_data_migrations"
- "need_service_restart" - "need_service_restart"

View File

@ -11,7 +11,7 @@
dest: "/etc/manila/{{ item | basename }}" dest: "/etc/manila/{{ item | basename }}"
owner: "{{ manila_system_user_name }}" owner: "{{ manila_system_user_name }}"
group: "{{ manila_system_group_name }}" group: "{{ manila_system_group_name }}"
mode: 0600 mode: "0600"
loop: loop:
- "{{ manila_keypair_path }}.pub" - "{{ manila_keypair_path }}.pub"
- "{{ manila_keypair_path }}" - "{{ manila_keypair_path }}"

View File

@ -24,6 +24,7 @@
file: file:
state: "directory" state: "directory"
path: "/etc/lvm" path: "/etc/lvm"
mode: "0755"
when: when:
- lvm_devices.rc == 0 - lvm_devices.rc == 0
@ -34,5 +35,6 @@
owner: "root" owner: "root"
group: "root" group: "root"
backup: "yes" backup: "yes"
mode: "0644"
when: when:
- lvm_devices.rc == 0 - lvm_devices.rc == 0

View File

@ -27,8 +27,8 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "root" owner: "root"
group: "{{ item.group|default(manila_system_group_name) }}" group: "{{ item.group | default(manila_system_group_name) }}"
mode: "{{ item.mode |default('0640') }}" mode: "{{ item.mode | default('0640') }}"
config_overrides: "{{ item.config_overrides | default({}) }}" config_overrides: "{{ item.config_overrides | default({}) }}"
config_type: "{{ item.config_type }}" config_type: "{{ item.config_type }}"
when: item.condition | default(True) when: item.condition | default(True)

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: create the system group - name: Create the system group
group: group:
name: "{{ manila_system_group_name }}" name: "{{ manila_system_group_name }}"
gid: "{{ manila_system_group_gid | default(omit) }}" gid: "{{ manila_system_group_gid | default(omit) }}"
@ -23,7 +23,7 @@
- name: Create the manila system user - name: Create the manila system user
user: user:
name: "{{ manila_system_user_name }}" name: "{{ manila_system_user_name }}"
uid: "{{ manila_system_user_uid|default(omit) }}" uid: "{{ manila_system_user_uid | default(omit) }}"
group: "{{ manila_system_group_name }}" group: "{{ manila_system_group_name }}"
comment: "{{ manila_system_comment }}" comment: "{{ manila_system_comment }}"
shell: "{{ manila_system_shell }}" shell: "{{ manila_system_shell }}"

View File

@ -13,8 +13,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
_manila_is_first_play_host: "{{ (manila_services['manila-api']['group'] in group_names and inventory_hostname == (groups[manila_services['manila-api']['group']] | intersect(ansible_play_hosts)) | first) | bool }}" _manila_is_first_play_host: >-
_manila_share_is_first_play_host: "{{ (manila_services['manila-share']['group'] in group_names and inventory_hostname == (groups[manila_services['manila-share']['group']] | intersect(ansible_play_hosts)) | first) | bool }}" {{
(manila_services['manila-api']['group'] in group_names and
inventory_hostname == (groups[manila_services['manila-api']['group']] | intersect(ansible_play_hosts)) | first) | bool
}}
_manila_share_is_first_play_host: >-
{{
(manila_services['manila-share']['group'] in group_names and
inventory_hostname == (groups[manila_services['manila-share']['group']] | intersect(ansible_play_hosts)) | first) | bool
}}
_manila_default_share_type_list: "{{ manila_backends.keys() | list }}" _manila_default_share_type_list: "{{ manila_backends.keys() | list }}"
_manila_default_share_type: "{{ ((_manila_default_share_type_list | length) > 0) | ternary(_manila_default_share_type_list[0], '') }}" _manila_default_share_type: "{{ ((_manila_default_share_type_list | length) > 0) | ternary(_manila_default_share_type_list[0], '') }}"

View File

@ -23,7 +23,7 @@
jobs: jobs:
- openstack-ansible-deploy-aio_metal-ubuntu-jammy - openstack-ansible-deploy-aio_metal-ubuntu-jammy
# NOTE(noonedeadpunk): Fails with OOM # NOTE(noonedeadpunk): Fails with OOM
- openstack-ansible-deploy-aio_metal-centos-8-stream: - openstack-ansible-deploy-aio_metal-centos-9-stream:
voting: false voting: false
- openstack-ansible-deploy-aio_lxc-ubuntu-jammy: - openstack-ansible-deploy-aio_lxc-ubuntu-jammy:
voting: false voting: false