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
This commit is contained in:
Dmitriy Rabotyagov 2023-07-14 20:17:05 +02:00 committed by Dmitriy Rabotyagov
parent 259dedd6e1
commit 6c783cde78
8 changed files with 30 additions and 20 deletions

View File

@ -15,8 +15,10 @@
# Define zookepeer version and download URI # Define zookepeer version and download URI
zookeeper_download_version: 3.7.1 zookeeper_download_version: 3.7.1
zookeeper_download_version_checksum: sha512:9103628a50745fa1a289bca666fda4a9c08ec17c55cf13e66887e7ba76e93dbae60a1f1ffd6c10798be3a16069344ecbc00cebb29bf03d9cd7096ccd098ed011 zookeeper_download_version_checksum: >-
zookeeper_download_url: "https://dlcdn.apache.org/zookeeper/zookeeper-{{ zookeeper_download_version }}/apache-zookeeper-{{ zookeeper_download_version }}-bin.tar.gz" sha512:9103628a50745fa1a289bca666fda4a9c08ec17c55cf13e66887e7ba76e93dbae60a1f1ffd6c10798be3a16069344ecbc00cebb29bf03d9cd7096ccd098ed011
zookeeper_download_url: >-
https://dlcdn.apache.org/zookeeper/zookeeper-{{ zookeeper_download_version }}/apache-zookeeper-{{ zookeeper_download_version }}-bin.tar.gz
# Define zookeeper clustering option # Define zookeeper clustering option
zookeeper_cluster_members: "{{ groups['zookeeper_all'] }}" zookeeper_cluster_members: "{{ groups['zookeeper_all'] }}"
@ -83,7 +85,8 @@ zookeeper_pki_install_ca:
zookeeper_pki_keys_path: "{{ zookeeper_pki_dir ~ '/certs/private/' }}" zookeeper_pki_keys_path: "{{ zookeeper_pki_dir ~ '/certs/private/' }}"
zookeeper_pki_certs_path: "{{ zookeeper_pki_dir ~ '/certs/certs/' }}" zookeeper_pki_certs_path: "{{ zookeeper_pki_dir ~ '/certs/certs/' }}"
zookeeper_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ZookeeperIntermediate') }}" zookeeper_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('ZookeeperIntermediate') }}"
zookeeper_pki_intermediate_cert_path: "{{ zookeeper_pki_dir ~ '/roots/' ~ zookeeper_pki_intermediate_cert_name ~ '/certs/' ~ zookeeper_pki_intermediate_cert_name ~ '.crt' }}" zookeeper_pki_intermediate_cert_path: >-
{{ zookeeper_pki_dir ~ '/roots/' ~ zookeeper_pki_intermediate_cert_name ~ '/certs/' ~ zookeeper_pki_intermediate_cert_name ~ '.crt' }}
zookeeper_pki_regen_cert: '' zookeeper_pki_regen_cert: ''
zookeeper_pki_certificates: zookeeper_pki_certificates:
- name: "zookeeper_{{ ansible_facts['hostname'] }}" - name: "zookeeper_{{ ansible_facts['hostname'] }}"
@ -130,7 +133,7 @@ zookeeper_system_comment: zookeeper system user
zookeeper_system_shell: /bin/false zookeeper_system_shell: /bin/false
zookeeper_system_user_home: /var/lib/zookeeper zookeeper_system_user_home: /var/lib/zookeeper
zookeeper_file_zoo_conf_mode: 0644 zookeeper_file_zoo_conf_mode: "0644"
zookeeper_config_dir: "/etc/zookeeper" zookeeper_config_dir: "/etc/zookeeper"
zookeeper_data_dir: "{{ zookeeper_system_user_home }}" zookeeper_data_dir: "{{ zookeeper_system_user_home }}"
zookeeper_data_log_dir: "{{ zookeeper_data_dir }}/log" zookeeper_data_log_dir: "{{ zookeeper_data_dir }}/log"

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
- name: regen pem - name: Regen pem # noqa: no-changed-when
shell: > shell: >-
cat {{ zookeeper_ssl_cert }} $(test -f {{ zookeeper_ssl_ca_cert }} && echo {{ zookeeper_ssl_ca_cert }}) {{ zookeeper_ssl_key }} > {{ zookeeper_ssl_keystore_location }} cat {{ zookeeper_ssl_cert }} $(test -f {{ zookeeper_ssl_ca_cert }} &&
echo {{ zookeeper_ssl_ca_cert }}) {{ zookeeper_ssl_key }} > {{ zookeeper_ssl_keystore_location }}
notify: Restart zookeeper notify: Restart zookeeper
listen: listen:
- cert installed - cert installed

View File

@ -16,8 +16,9 @@
galaxy_info: galaxy_info:
author: OpenStack-Ansible Contributors author: OpenStack-Ansible Contributors
role_name: zookeeper role_name: zookeeper
namespace: openstack
description: | description: |
Zookeeper is a high-performance coordination service for distributed applications. Zookeeper is a high-performance coordination service for distributed applications.
license: Apache license: Apache
min_ansible_version: 5.0 min_ansible_version: "5.0"
dependencies: [] dependencies: []

View File

@ -28,21 +28,24 @@
tags: tags:
- always - always
- import_tasks: zookeeper_pre_install.yml - name: Importing zookeeper_pre_install tasks
import_tasks: zookeeper_pre_install.yml
tags: tags:
- zookeeper-install - zookeeper-install
- import_tasks: zookeeper_install.yml - name: Importing zookeeper_install tasks
import_tasks: zookeeper_install.yml
tags: tags:
- zookeeper-install - zookeeper-install
- import_tasks: zookeeper_post_install.yml - name: Importing zookeeper_post_install tasks
import_tasks: zookeeper_post_install.yml
tags: tags:
- zookeeper-config - zookeeper-config
- name: Create and install SSL certificates - name: Create and install SSL certificates
include_role: include_role:
name: pki name: pki
vars: vars:
pki_setup_host: "{{ zookeeper_pki_setup_host }}" pki_setup_host: "{{ zookeeper_pki_setup_host }}"
pki_dir: "{{ zookeeper_pki_dir }}" pki_dir: "{{ zookeeper_pki_dir }}"
@ -66,10 +69,10 @@
systemd_tempd_prefix: openstack systemd_tempd_prefix: openstack
systemd_slice_name: zookeeper systemd_slice_name: zookeeper
systemd_lock_path: /var/lock/zookeeper systemd_lock_path: /var/lock/zookeeper
systemd_CPUAccounting: true systemd_service_cpu_accounting: true
systemd_BlockIOAccounting: true systemd_service_block_io_accounting: true
systemd_MemoryAccounting: true systemd_service_memory_accounting: true
systemd_TasksAccounting: true systemd_service_tasks_accounting: true
systemd_services: systemd_services:
- service_name: "{{ zookeeper_service['name'] }}" - service_name: "{{ zookeeper_service['name'] }}"
enabled: yes enabled: yes

View File

@ -28,6 +28,7 @@
url: "{{ zookeeper_download_url }}" url: "{{ zookeeper_download_url }}"
dest: "/opt/{{ zookeeper_download_url | basename }}" dest: "/opt/{{ zookeeper_download_url | basename }}"
checksum: "{{ zookeeper_download_version_checksum }}" checksum: "{{ zookeeper_download_version_checksum }}"
mode: "0644"
register: zookeeper_download register: zookeeper_download
- name: Unarchive downloaded zookeeper - name: Unarchive downloaded zookeeper

View File

@ -18,6 +18,7 @@
src: "{{ item }}" src: "{{ item }}"
dest: "{{ zookeeper_config_dir }}/{{ item | basename }}" dest: "{{ zookeeper_config_dir }}/{{ item | basename }}"
remote_src: yes remote_src: yes
mode: "0644"
with_items: with_items:
- "/opt/zookeeper-{{ zookeeper_download_version }}/conf/configuration.xsl" - "/opt/zookeeper-{{ zookeeper_download_version }}/conf/configuration.xsl"
- "/opt/zookeeper-{{ zookeeper_download_version }}/conf/log4j.properties" - "/opt/zookeeper-{{ zookeeper_download_version }}/conf/log4j.properties"

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
- name: create the system group - name: Create the system group
group: group:
name: "{{ zookeeper_system_group_name }}" name: "{{ zookeeper_system_group_name }}"
gid: "{{ zookeeper_system_group_gid | default(omit) }}" gid: "{{ zookeeper_system_group_gid | default(omit) }}"
@ -36,7 +36,7 @@
path: "{{ item }}" path: "{{ item }}"
owner: "{{ zookeeper_system_user_name }}" owner: "{{ zookeeper_system_user_name }}"
group: "{{ zookeeper_system_group_name }}" group: "{{ zookeeper_system_group_name }}"
mode: 0750 mode: "0750"
state: directory state: directory
with_items: with_items:
- "{{ zookeeper_config_dir }}" - "{{ zookeeper_config_dir }}"

View File

@ -15,7 +15,7 @@
zookeeper_cluster_id: >- zookeeper_cluster_id: >-
{%- for member in zookeeper_cluster_members -%} {%- for member in zookeeper_cluster_members -%}
{%- if hostvars[member]['ansible_host'] == ansible_host -%} {%- if hostvars[member]['ansible_host'] == ansible_host -%}
{{ loop.index }} {{ loop.index }}
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}