Dmitriy Rabotyagov 6c783cde78 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: Iaa81bfe9c524d9818d19019d5a09cf8e817d8396
2023-07-18 09:32:19 +00:00

86 lines
3.2 KiB
YAML

---
# Copyright 2022 City Network International AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Gather variables for each operating system
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}.yml"
paths:
- "{{ role_path }}/vars"
tags:
- always
- name: Importing zookeeper_pre_install tasks
import_tasks: zookeeper_pre_install.yml
tags:
- zookeeper-install
- name: Importing zookeeper_install tasks
import_tasks: zookeeper_install.yml
tags:
- zookeeper-install
- name: Importing zookeeper_post_install tasks
import_tasks: zookeeper_post_install.yml
tags:
- zookeeper-config
- name: Create and install SSL certificates
include_role:
name: pki
vars:
pki_setup_host: "{{ zookeeper_pki_setup_host }}"
pki_dir: "{{ zookeeper_pki_dir }}"
pki_create_ca: "{{ zookeeper_pki_create_ca }}"
pki_authorities: "{{ zookeeper_pki_authorities }}"
pki_install_ca: "{{ zookeeper_pki_install_ca }}"
pki_regen_ca: "{{ zookeeper_pki_regen_ca }}"
pki_create_certificates: "{{ zookeeper_user_ssl_cert is not defined and zookeeper_user_ssl_key is not defined }}"
pki_regen_cert: "{{ zookeeper_pki_regen_cert }}"
pki_certificates: "{{ zookeeper_pki_certificates }}"
pki_install_certificates: "{{ zookeeper_pki_install_certificates }}"
when:
- zookeeper_ssl_client_enable or zookeeper_ssl_quorum_enable
- name: Run the systemd service role
include_role:
name: systemd_service
vars:
systemd_user_name: "{{ zookeeper_system_user_name }}"
systemd_group_name: "{{ zookeeper_system_group_name }}"
systemd_tempd_prefix: openstack
systemd_slice_name: zookeeper
systemd_lock_path: /var/lock/zookeeper
systemd_service_cpu_accounting: true
systemd_service_block_io_accounting: true
systemd_service_memory_accounting: true
systemd_service_tasks_accounting: true
systemd_services:
- service_name: "{{ zookeeper_service['name'] }}"
enabled: yes
restart_changed: false
execstarts: "{{ zookeeper_service['execstarts'] }}"
execstops: "{{ zookeeper_service['execstops'] }}"
config_overrides: "{{ zookeeper_init_config_overrides }}"
tags:
- zookeeper-config
- systemd-service