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: I6ca96cd72600e59c2e6616880d7cd9155a26c5bb
This commit is contained in:
Dmitriy Rabotyagov 2023-07-14 14:42:55 +02:00 committed by Dmitriy Rabotyagov
parent 3464966868
commit d41ac57fe4
7 changed files with 59 additions and 30 deletions

View File

@ -23,7 +23,11 @@ designate_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (gro
# for the service setup. The host must already have # for the service setup. The host must already have
# clouds.yaml properly configured. # clouds.yaml properly configured.
designate_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" designate_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
designate_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((designate_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" designate_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(designate_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
# Set the package install state for distribution packages # Set the package install state for distribution packages
# Options are 'present' and 'latest' # Options are 'present' and 'latest'
@ -36,7 +40,8 @@ designate_venv_python_executable: "{{ openstack_venv_python_executable | default
## The git source/branch ## The git source/branch
designate_git_repo: https://opendev.org/openstack/designate designate_git_repo: https://opendev.org/openstack/designate
designate_git_install_branch: master designate_git_install_branch: master
designate_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" designate_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
designate_git_constraints: designate_git_constraints:
- "--constraint {{ designate_upper_constraints_url }}" - "--constraint {{ designate_upper_constraints_url }}"
@ -71,7 +76,11 @@ designate_coordination_url: "{{ _designate_coordination_url | default() }}"
## Database info ## Database info
designate_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}" designate_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
designate_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((designate_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" designate_db_setup_python_interpreter: >-
{{
openstack_db_setup_python_interpreter | default(
(designate_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable']))
}}
designate_galera_address: "{{ galera_address | default('127.0.0.1') }}" designate_galera_address: "{{ galera_address | default('127.0.0.1') }}"
designate_galera_user: designate designate_galera_user: designate
designate_galera_database: designate designate_galera_database: designate
@ -98,7 +107,8 @@ designate_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify # Notify
designate_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}" designate_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
designate_oslomsg_notify_setup_host: "{{ (designate_oslomsg_notify_host_group in groups) | ternary(groups[designate_oslomsg_notify_host_group][0], 'localhost') }}" designate_oslomsg_notify_setup_host: >-
{{ (designate_oslomsg_notify_host_group in groups) | ternary(groups[designate_oslomsg_notify_host_group][0], 'localhost') }}
designate_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}" designate_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"
designate_oslomsg_notify_servers: "{{ oslomsg_notify_servers | default('127.0.0.1') }}" designate_oslomsg_notify_servers: "{{ oslomsg_notify_servers | default('127.0.0.1') }}"
designate_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}" designate_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}"
@ -307,5 +317,5 @@ designate_pki_install_certificates:
mode: "0600" mode: "0600"
# Define user-provided SSL certificates # Define user-provided SSL certificates
#designate_user_ssl_cert: <path to cert on ansible deployment host> # designate_user_ssl_cert: <path to cert on ansible deployment host>
#designate_user_ssl_key: <path to cert on ansible deployment host> # designate_user_ssl_key: <path to cert on ansible deployment host>

View File

@ -18,19 +18,21 @@ galaxy_info:
description: Installation and setup of Designate description: Installation and setup of Designate
company: OpenStack company: OpenStack
license: Apache2 license: Apache2
min_ansible_version: 2.2 role_name: os_designate
namespace: openstack
min_ansible_version: "2.10"
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- buster - bullseye
- name: Ubuntu - name: Ubuntu
versions: versions:
- bionic
- focal - focal
- jammy
- name: EL - name: EL
versions: versions:
- 8 - "9"
categories: galaxy_tags:
- cloud - cloud
- python - python
- designate - designate

View File

@ -19,6 +19,7 @@
section: "designate" section: "designate"
option: "install_method" option: "install_method"
value: "{{ designate_install_method }}" value: "{{ designate_install_method }}"
mode: "0644"
- name: Refresh local facts to ensure the designate section is present - name: Refresh local facts to ensure the designate section is present
setup: setup:

View File

@ -16,7 +16,7 @@
- name: Get project id for managed resources - name: Get project id for managed resources
delegate_to: "{{ designate_service_setup_host }}" delegate_to: "{{ designate_service_setup_host }}"
vars: vars:
ansible_python_interpreter: "{{ designate_service_setup_host_python_interpreter }}" ansible_python_interpreter: "{{ designate_service_setup_host_python_interpreter }}"
openstack.cloud.project_info: openstack.cloud.project_info:
cloud: default cloud: default
name: "{{ designate_managed_resource_project_name }}" name: "{{ designate_managed_resource_project_name }}"
@ -35,8 +35,8 @@
openstack.config_template.config_template: openstack.config_template.config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ item.owner|default(designate_system_user_name) }}" owner: "{{ item.owner | default(designate_system_user_name) }}"
group: "{{ item.group|default(designate_system_group_name) }}" group: "{{ item.group | default(designate_system_group_name) }}"
mode: "0644" mode: "0644"
config_overrides: "{{ item.config_overrides }}" config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}" config_type: "{{ item.config_type }}"
@ -95,6 +95,7 @@
dest: "/etc/designate/rootwrap.d/" dest: "/etc/designate/rootwrap.d/"
owner: "root" owner: "root"
group: "root" group: "root"
mode: "0644"
with_fileglob: with_fileglob:
- rootwrap.d/* - rootwrap.d/*
notify: Restart designate services notify: Restart designate services

View File

@ -33,9 +33,9 @@
file: file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: directory state: directory
owner: "{{ item.owner|default(designate_system_user_name) }}" owner: "{{ item.owner | default(designate_system_user_name) }}"
group: "{{ item.group|default(designate_system_group_name) }}" group: "{{ item.group | default(designate_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}" mode: "{{ item.mode | default('0755') }}"
with_items: with_items:
- { path: "/openstack/venvs", mode: "0755", owner: "root", group: "root" } - { path: "/openstack/venvs", mode: "0755", owner: "root", group: "root" }
- { path: "/etc/designate" } - { path: "/etc/designate" }

View File

@ -43,7 +43,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:
@ -64,7 +65,8 @@
tags: tags:
- always - always
- include_role: - name: Including osa.mq_setup role
include_role:
name: openstack.osa.mq_setup name: openstack.osa.mq_setup
apply: apply:
tags: tags:
@ -87,11 +89,13 @@
tags: tags:
- always - always
- import_tasks: designate_pre_install.yml - name: Importing designate_pre_install tasks
import_tasks: designate_pre_install.yml
tags: tags:
- designate-install - designate-install
- import_tasks: designate_install.yml - name: Importing designate_install tasks
import_tasks: designate_install.yml
tags: tags:
- designate-install - designate-install
@ -115,12 +119,14 @@
tags: tags:
- always - always
- import_tasks: designate_post_install.yml - name: Importing designate_post_install tasks
import_tasks: designate_post_install.yml
tags: tags:
- designate-install - designate-install
- designate-config - designate-config
- include_role: - name: Including osa.service_setup tasks
include_role:
name: openstack.osa.service_setup name: openstack.osa.service_setup
apply: apply:
tags: tags:
@ -165,10 +171,10 @@
systemd_tempd_prefix: openstack systemd_tempd_prefix: openstack
systemd_slice_name: designate systemd_slice_name: designate
systemd_lock_path: /var/lock/designate systemd_lock_path: /var/lock/designate
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: "{{ filtered_designate_services }}" systemd_services: "{{ filtered_designate_services }}"
tags: tags:
- designate-config - designate-config
@ -177,7 +183,8 @@
- name: Flush handlers - name: Flush handlers
meta: flush_handlers meta: flush_handlers
- import_tasks: designate_db_sync.yml - name: Importing designate_db_sync tasks
import_tasks: designate_db_sync.yml
when: _designate_is_first_play_host when: _designate_is_first_play_host
tags: tags:
- designate-install - designate-install
@ -186,6 +193,9 @@
copy: copy:
content: "{{ designate_pools_yaml | to_nice_yaml }}" content: "{{ designate_pools_yaml | to_nice_yaml }}"
dest: "/etc/designate/pools.yaml" dest: "/etc/designate/pools.yaml"
mode: "0640"
owner: "{{ designate_system_user_name }}"
group: "{{ designate_system_group_name }}"
when: when:
- designate_pools_yaml is defined - designate_pools_yaml is defined
- _designate_is_first_play_host - _designate_is_first_play_host

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.
_designate_is_first_play_host: "{{ (designate_services['designate-api']['group'] in group_names and inventory_hostname == (groups[designate_services['designate-api']['group']] | intersect(ansible_play_hosts)) | first) | bool }}" _designate_is_first_play_host: >-
{{
(designate_services['designate-api']['group'] in group_names and
inventory_hostname == (groups[designate_services['designate-api']['group']] | intersect(ansible_play_hosts)) | first) | bool
}}
# #
# Compile a list of the services on a host based on whether # Compile a list of the services on a host based on whether
@ -46,4 +50,5 @@ _designate_coordination_url: >-
groups[designate_coordination_group] groups[designate_coordination_group]
| map('extract', hostvars, 'ansible_host') | map('extract', hostvars, 'ansible_host')
| list | join(':' ~ designate_coordination_port ~ ',') | list | join(':' ~ designate_coordination_port ~ ',')
}}:{{ designate_coordination_port }}?namespace={{ designate_coordination_namespace }}{% if designate_coordination_client_ssl | bool %}&use_ssl=True&verify_certs={{ designate_coordination_verify_cert | bool }}{% endif %} }}:{{ designate_coordination_port }}?namespace={{ designate_coordination_namespace -}}
{%- if designate_coordination_client_ssl | bool %}&use_ssl=True&verify_certs={{ designate_coordination_verify_cert | bool }}{% endif %}