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: I30eff91392dcab1e76c4fee89ead7a6e03838b2d
This commit is contained in:
Dmitriy Rabotyagov 2023-07-14 19:56:42 +02:00
parent 81a0273a50
commit 1c49c7d2c8
6 changed files with 54 additions and 31 deletions

View File

@ -14,14 +14,18 @@
## Verbosity Options
debug: False
#python venv executable
# python venv executable
sahara_venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}"
# Set the host which will execute the shade modules
# for the service setup. The host must already have
# clouds.yaml properly configured.
sahara_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
sahara_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((sahara_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
sahara_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(sahara_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
# Set the package install state for distribution packages
# Options are 'present' and 'latest'
@ -29,7 +33,8 @@ sahara_package_state: "{{ package_state | default('latest') }}"
sahara_git_repo: https://opendev.org/openstack/sahara
sahara_git_install_branch: master
sahara_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}"
sahara_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
sahara_git_constraints:
- "--constraint {{ sahara_upper_constraints_url }}"
@ -90,7 +95,11 @@ sahara_oslomsg_amqp1_enabled: "{{ sahara_oslomsg_rpc_transport == 'amqp' }}"
## Database info
sahara_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
sahara_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((sahara_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
sahara_db_setup_python_interpreter: >-
{{
openstack_db_setup_python_interpreter | default(
(sahara_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
sahara_galera_address: "{{ galera_address | default('127.0.0.1') }}"
sahara_galera_database: sahara
sahara_galera_user: sahara
@ -167,7 +176,8 @@ sahara_plugin_pip_packages:
## Cap the maximum number of threads / workers when a user value is unspecified.
sahara_api_workers_max: 16
sahara_api_workers: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, sahara_api_workers_max] | min }}"
sahara_api_workers: >-
{{ [[(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2, sahara_api_workers_max] | min }}
sahara_task_executor: taskflow
sahara_digest_algorithm: sha256
@ -181,9 +191,9 @@ sahara_policy_dirs: policy.d
## Policy vars
# 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.
#sahara_policy_overrides:
# "clusters:get_all": ""
# "clusters:create": ""
# sahara_policy_overrides:
# "clusters:get_all": ""
# "clusters:create": ""
sahara_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
@ -233,7 +243,7 @@ sahara_services:
## Sahara uWSGI settings
sahara_wsgi_processes_max: 16
sahara_wsgi_processes: "{{ [[ansible_facts['processor_vcpus']|default(1), 1] | max * 2, sahara_wsgi_processes_max] | min }}"
sahara_wsgi_processes: "{{ [[ansible_facts['processor_vcpus'] | default(1), 1] | max * 2, sahara_wsgi_processes_max] | min }}"
sahara_wsgi_threads: 1
sahara_uwsgi_tls:
crt: "{{ sahara_ssl_cert }}"
@ -291,5 +301,5 @@ sahara_pki_install_certificates:
mode: "0600"
# Define user-provided SSL certificates
#sahara_user_ssl_cert: <path to cert on ansible deployment host>
#sahara_user_ssl_key: <path to cert on ansible deployment host>
# sahara_user_ssl_cert: <path to cert on ansible deployment host>
# sahara_user_ssl_key: <path to cert on ansible deployment host>

View File

@ -4,19 +4,21 @@ galaxy_info:
description: Installation and setup of sahara
company: LSD/UFCG
license: Apache2
min_ansible_version: 2.2
role_name: os_sahara
namespace: openstack
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
- sahara

View File

@ -23,7 +23,8 @@
tags:
- always
- include_role:
- name: Including osa.db_setup role
include_role:
name: openstack.osa.db_setup
apply:
tags:
@ -44,7 +45,8 @@
tags:
- always
- include_role:
- name: Including osa.mq_setup role
include_role:
name: openstack.osa.mq_setup
apply:
tags:
@ -66,7 +68,8 @@
tags:
- always
- import_tasks: sahara_pre_install.yml
- name: Importing sahara_pre_install tasks
import_tasks: sahara_pre_install.yml
tags:
- sahara-install
@ -111,7 +114,8 @@
tags:
- sahara-install
- import_tasks: sahara_post_install.yml
- name: Importing sahara_post_install tasks
import_tasks: sahara_post_install.yml
tags:
- sahara-config
@ -134,21 +138,23 @@
systemd_tempd_prefix: openstack
systemd_slice_name: sahara
systemd_lock_path: /var/lock/sahara
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: "{{ filtered_sahara_services }}"
tags:
- sahara-config
- systemd-service
- import_tasks: sahara_db_sync.yml
- name: Importing sahara_db_sync tasks
import_tasks: sahara_db_sync.yml
when: _sahara_is_first_play_host
tags:
- sahara-config
- include_role:
- name: Including osa.service_setup role
include_role:
name: openstack.osa.service_setup
apply:
tags:

View File

@ -67,6 +67,7 @@
dest: "/etc/sahara/rootwrap.d/"
owner: "root"
group: "root"
mode: "0644"
with_fileglob:
- rootwrap.d/*
notify:

View File

@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: create the system group
- name: Create the system group
group:
name: "{{ sahara_system_group_name }}"
state: "present"
@ -31,9 +31,9 @@
file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner|default(sahara_system_user_name) }}"
group: "{{ item.group|default(sahara_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}"
owner: "{{ item.owner | default(sahara_system_user_name) }}"
group: "{{ item.group | default(sahara_system_group_name) }}"
mode: "{{ item.mode | default('0755') }}"
with_items:
- { path: "/openstack/venvs", mode: "0755", owner: "root", group: "root" }
- { path: "/etc/sahara" }

View File

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