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.

Change-Id: I022c2ed5edb0acb80433a29172bd6617e994f30f
This commit is contained in:
Dmitriy Rabotyagov 2023-08-22 12:45:59 +02:00
parent 6474c35998
commit 9917675a9f
6 changed files with 49 additions and 25 deletions

View File

@ -32,7 +32,8 @@ mistral_git_repo: https://opendev.org/openstack/mistral
mistral_git_install_branch: master
mistral_extra_git_repo: https://opendev.org/openstack/mistral-extra
mistral_extra_git_install_branch: master
mistral_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}"
mistral_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
mistral_git_constraints:
- "--constraint {{ mistral_upper_constraints_url }}"
mistral_pip_packages:
@ -89,7 +90,8 @@ mistral_services:
# UWSGI settings
mistral_wsgi_processes_max: 16
mistral_wsgi_processes: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, mistral_wsgi_processes_max] | min }}"
mistral_wsgi_processes: >-
{{ [[(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2, mistral_wsgi_processes_max] | min }}
mistral_wsgi_threads: 1
mistral_uwsgi_tls:
crt: "{{ mistral_ssl_cert }}"
@ -125,7 +127,11 @@ mistral_oslomsg_amqp1_enabled: "{{ mistral_oslomsg_rpc_transport == 'amqp' }}"
# Database
mistral_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
mistral_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((mistral_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
mistral_db_setup_python_interpreter: >-
{{
openstack_db_setup_python_interpreter | default(
(mistral_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
mistral_galera_address: "{{ galera_address | default('127.0.0.1') }}"
mistral_galera_database: mistral
mistral_galera_user: mistral
@ -153,7 +159,11 @@ mistral_policy_overrides: {}
# Service setup
mistral_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
mistral_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((mistral_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
mistral_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(mistral_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
mistral_service_name: mistral
mistral_service_type: workflowv2
mistral_service_description: OpenStack Workflow service
@ -225,5 +235,5 @@ mistral_pki_install_certificates:
mode: "0600"
# Define user-provided SSL certificates
#mistral_user_ssl_cert: <path to cert on ansible deployment host>
#mistral_user_ssl_key: <path to cert on ansible deployment host>
# mistral_user_ssl_cert: <path to cert on ansible deployment host>
# mistral_user_ssl_key: <path to cert on ansible deployment host>

View File

@ -18,19 +18,21 @@ galaxy_info:
description: Installation and setup of mistral
company: Vexxhost
license: Apache2
min_ansible_version: 2.7
namespace: openstack
role_name: os_mistral
min_ansible_version: "2.10"
platforms:
- name: Debian
versions:
- buster
- bullseye
- name: Ubuntu
versions:
- bionic
- focal
- jammy
- name: EL
versions:
- 8
categories:
- "9"
galaxy_tags:
- cloud
- python
- glance

View File

@ -43,7 +43,8 @@
tags:
- always
- include_role:
- name: Including osa.db_setup role
include_role:
name: openstack.osa.db_setup
apply:
tags:
@ -64,7 +65,8 @@
tags:
- always
- include_role:
- name: Including osa.mq_setup role
include_role:
name: openstack.osa.mq_setup
apply:
tags:
@ -86,7 +88,8 @@
tags:
- always
- import_tasks: mistral_install.yml
- name: Importing mistral_install tasks
import_tasks: mistral_install.yml
tags:
- mistral-install
@ -110,11 +113,13 @@
tags:
- always
- import_tasks: mistral_post_install.yml
- name: Importing mistral_post_install tasks
import_tasks: mistral_post_install.yml
tags:
- mistral-config
- import_tasks: mistral_db_sync.yml
- name: Importing mistral_db_sync tasks
import_tasks: mistral_db_sync.yml
when:
- "_mistral_is_first_play_host"
tags:
@ -129,10 +134,10 @@
systemd_tempd_prefix: openstack
systemd_slice_name: mistral
systemd_lock_path: /var/lock/mistral
systemd_CPUAccounting: true
systemd_BlockIOAccounting: true
systemd_MemoryAccounting: true
systemd_TasksAccounting: true
systemd_service_cpu_accounting: true
systemd_service_block_io_accounting: true
systemd_service_memory_accounting: true
systemd_service_tasks_accounting: true
systemd_services: |-
{% set services = [] %}
{% for service in filtered_mistral_services %}
@ -163,7 +168,8 @@
- mistral-config
- uwsgi
- include_role:
- name: Including osa.service_setup role
include_role:
name: openstack.osa.service_setup
apply:
tags:

View File

@ -19,13 +19,14 @@
section: "mistral"
option: "install_method"
value: "{{ mistral_install_method }}"
mode: "0644"
- name: Refresh local facts to ensure the mistral section is present
setup:
filter: ansible_local
gather_subset: "!all"
- name: create the system group
- name: Create the system group
group:
name: "{{ mistral_system_group_name }}"
state: "present"
@ -93,5 +94,6 @@
section: "mistral"
option: "need_service_restart"
value: true
mode: "0644"
when: (install_packages is changed) or
('need_service_restart' not in ansible_local['openstack_ansible']['mistral'])

View File

@ -14,10 +14,10 @@
# limitations under the License.
mistral_package_list: |-
{% set packages = (mistral_distro_packages + mistral_service_distro_packages) %}
{% set packages = mistral_distro_packages + mistral_service_distro_packages %}
{% if mistral_oslomsg_amqp1_enabled | bool %}
{% set _ = packages.extend(mistral_oslomsg_amqp1_distro_packages) %}
{% endif %}
{{ packages }}
_mistral_bin: "/usr/bin"
_mistral_bin: "/usr/bin"

View File

@ -13,7 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_mistral_is_first_play_host: "{{ (mistral_services['mistral-api']['group'] in group_names and inventory_hostname == (groups[mistral_services['mistral-api']['group']] | intersect(ansible_play_hosts)) | first) | bool }}"
_mistral_is_first_play_host: >-
{{
(mistral_services['mistral-api']['group'] in group_names and
inventory_hostname == (groups[mistral_services['mistral-api']['group']] | intersect(ansible_play_hosts)) | first) | bool
}}
#
# Compile a list of the services on a host based on whether