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_repo: https://opendev.org/openstack/adjutant
adjutant_git_install_branch: master 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: adjutant_git_constraints:
- "--constraint {{ adjutant_upper_constraints_url }}" - "--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_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}"
adjutant_galera_port: "{{ galera_port | default('3306') }}" adjutant_galera_port: "{{ galera_port | default('3306') }}"
adjutant_galera_setup_host: "{{ openstack_db_setup_host | default('localhost') }}" 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 ## Service Type and Data
adjutant_role_name: admin adjutant_role_name: admin
@ -60,7 +65,11 @@ adjutant_service_port: 5050
adjutant_service_project_name: service adjutant_service_project_name: service
adjutant_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}" adjutant_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
adjutant_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" 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_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}"
adjutant_service_proto: http adjutant_service_proto: http
adjutant_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(adjutant_service_proto) }}" 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 # uWSGI settings
adjutant_wsgi_threads: 1 adjutant_wsgi_threads: 1
adjutant_wsgi_processes_max: 16 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_use_uwsgi: True
adjutant_uwsgi_tls: adjutant_uwsgi_tls:
crt: "{{ adjutant_ssl_cert }}" crt: "{{ adjutant_ssl_cert }}"
@ -263,7 +273,7 @@ adjutant_pip_packages:
- systemd-python - systemd-python
adjutant_pip_extra_packages: adjutant_pip_extra_packages:
- mysqlclient - mysqlclient
### ###
### Backend TLS ### Backend TLS
@ -310,5 +320,5 @@ adjutant_pki_install_certificates:
mode: "0600" mode: "0600"
# Define user-provided SSL certificates # Define user-provided SSL certificates
#adjutant_user_ssl_cert: <path to cert on ansible deployment host> # adjutant_user_ssl_cert: <path to cert on ansible deployment host>
#adjutant_user_ssl_key: <path to cert on ansible deployment host> # adjutant_user_ssl_key: <path to cert on ansible deployment host>

View File

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

View File

@ -35,9 +35,9 @@
file: file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: directory state: directory
owner: "{{ item.owner|default(adjutant_system_user_name) }}" owner: "{{ item.owner | default(adjutant_system_user_name) }}"
group: "{{ item.group|default(adjutant_system_group_name) }}" group: "{{ item.group | default(adjutant_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}" mode: "{{ item.mode | default('0755') }}"
with_items: with_items:
- { path: "/openstack", mode: "0755", owner: "root", group: "root" } - { path: "/openstack", mode: "0755", owner: "root", group: "root" }
- { path: "/etc/adjutant" } - { path: "/etc/adjutant" }

View File

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

View File

@ -13,7 +13,11 @@
# 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.
_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: |- filtered_adjutant_services: |-
{% set services = [] %} {% set services = [] %}