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: I558a0fee0b0bf8c86f5bd73dca2b9571f3e4e287
This commit is contained in:
Dmitriy Rabotyagov 2023-07-13 15:55:45 +02:00 committed by Dmitriy Rabotyagov
parent fb228dc778
commit ee7a011b2f
5 changed files with 47 additions and 27 deletions

View File

@ -33,7 +33,8 @@ adjutant_bin: "/openstack/venvs/adjutant-{{ adjutant_venv_tag }}/bin"
adjutant_git_repo: https://opendev.org/openstack/adjutant
adjutant_git_install_branch: master
adjutant_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}"
adjutant_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
adjutant_git_constraints:
- "--constraint {{ adjutant_upper_constraints_url }}"
@ -48,7 +49,11 @@ adjutant_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
adjutant_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}"
adjutant_galera_port: "{{ galera_port | default('3306') }}"
adjutant_galera_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
adjutant_galera_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((adjutant_galera_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
adjutant_galera_setup_python_interpreter: >-
{{
openstack_db_setup_python_interpreter | default(
(adjutant_galera_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']))
}}
## Service Type and Data
adjutant_role_name: admin
@ -60,7 +65,11 @@ adjutant_service_port: 5050
adjutant_service_project_name: service
adjutant_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
adjutant_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
adjutant_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((adjutant_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
adjutant_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(adjutant_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']))
}}
adjutant_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}"
adjutant_service_proto: http
adjutant_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(adjutant_service_proto) }}"
@ -77,7 +86,8 @@ adjutant_horizon_publicurl: "{{ openstack_service_publicuri_proto | default(adju
# uWSGI settings
adjutant_wsgi_threads: 1
adjutant_wsgi_processes_max: 16
adjutant_wsgi_processes: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, adjutant_wsgi_processes_max] | min }}"
adjutant_wsgi_processes: >-
{{ [[(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2, adjutant_wsgi_processes_max] | min }}
adjutant_use_uwsgi: True
adjutant_uwsgi_tls:
crt: "{{ adjutant_ssl_cert }}"

View File

@ -18,17 +18,17 @@ galaxy_info:
description: Installation and setup of Adjutant
company: ELASTX
license: Apache2
min_ansible_version: 2.2
role_name: os_adjutant
namespace: openstack
min_ansible_version: "2.10"
platforms:
- name: Ubuntu
versions:
- xenial
categories:
- focal
- jammy
galaxy_tags:
- cloud
- python
- adjutant
- development
- openstack
dependencies:
- apt_package_pinning
- openstack_openrc

View File

@ -30,7 +30,8 @@
tags:
- always
- include_role:
- name: Including osa.db_setup role
include_role:
name: openstack.osa.db_setup
apply:
tags:
@ -50,11 +51,13 @@
tags:
- always
- import_tasks: adjutant_pre_install.yml
- name: Importing adjutant_pre_install tasks
import_tasks: adjutant_pre_install.yml
tags:
- adjutant-install
- import_tasks: adjutant_install.yml
- name: Importing adjutant_install tasks
import_tasks: adjutant_install.yml
tags:
- adjutant-install
@ -78,16 +81,19 @@
tags:
- always
- import_tasks: adjutant_post_install.yml
- name: Importing adjutant_post_install tasks
import_tasks: adjutant_post_install.yml
tags:
- adjutant-config
- import_tasks: adjutant_db_sync.yml
- name: Importing adjutant_db_sync tasks
import_tasks: adjutant_db_sync.yml
when: _adjutant_is_first_play_host
tags:
- adjutant-config
- include_role:
- name: Including osa.service_setup role
include_role:
name: openstack.osa.service_setup
apply:
tags:
@ -133,10 +139,10 @@
systemd_tempd_prefix: openstack
systemd_slice_name: adjutant
systemd_lock_path: /var/lock/adjutant
systemd_CPUAccounting: true
systemd_BlockIOAccounting: true
systemd_MemoryAccounting: true
systemd_TasksAccounting: true
systemd_service_cpu_accounting: true
systemd_service_block_io_accounting: true
systemd_memory_accounting: true
systemd_tasks_accounting: true
systemd_services:
- service_name: "{{ service_var.service_name }}"
enabled: "{{ service_var.enabled | default(True) }}"

View File

@ -13,7 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_adjutant_is_first_play_host: "{{ (adjutant_services['adjutant-api']['group'] in group_names and inventory_hostname == (groups[adjutant_services['adjutant-api']['group']] | intersect(ansible_play_hosts)) | first) | bool }}"
_adjutant_is_first_play_host: >-
{{
(adjutant_services['adjutant-api']['group'] in group_names and
inventory_hostname == (groups[adjutant_services['adjutant-api']['group']] | intersect(ansible_play_hosts)) | first) | bool
}}
filtered_adjutant_services: |-
{% set services = [] %}