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: Ice967ef99da11e6bd5a7dffc0a5e3d377f8598f4
This commit is contained in:
Dmitriy Rabotyagov 2023-07-14 21:30:29 +02:00
parent a0b2ef25cd
commit dddc665165
6 changed files with 52 additions and 31 deletions

View File

@ -26,14 +26,18 @@ zun_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['c
## Verbosity Options ## Verbosity Options
debug: False debug: False
#python venv executable # python venv executable
zun_venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}" zun_venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}"
# Set the host which will execute the shade modules # Set the host which will execute the shade modules
# 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.
zun_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" zun_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
zun_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((zun_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" zun_service_setup_host_python_interpreter: >-
{{
openstack_service_setup_host_python_interpreter | default(
(zun_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'
@ -50,7 +54,8 @@ zun_kuryr_git_install_branch: master
zun_kuryr_lib_git_repo: https://opendev.org/openstack/kuryr zun_kuryr_lib_git_repo: https://opendev.org/openstack/kuryr
zun_kuryr_lib_git_install_branch: master zun_kuryr_lib_git_install_branch: master
zun_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" zun_upper_constraints_url: >-
{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}
zun_git_constraints: zun_git_constraints:
- "--constraint {{ zun_upper_constraints_url }}" - "--constraint {{ zun_upper_constraints_url }}"
@ -85,7 +90,8 @@ zun_kuryr_log_dir: "/var/log/kuryr"
zun_docker_package_version: "{{ _zun_docker_package_version }}" zun_docker_package_version: "{{ _zun_docker_package_version }}"
zun_containerd_package_version: "{{ _zun_containerd_package_version }}" zun_containerd_package_version: "{{ _zun_containerd_package_version }}"
zun_kata_package_version: "3.1.0" zun_kata_package_version: "3.1.0"
zun_kata_package_source: "https://github.com/kata-containers/kata-containers/releases/download/{{ zun_kata_package_version }}/kata-static-{{ zun_kata_package_version }}-x86_64.tar.xz" zun_kata_package_source: >-
https://github.com/kata-containers/kata-containers/releases/download/{{ zun_kata_package_version }}/kata-static-{{ zun_kata_package_version }}-x86_64.tar.xz
zun_kata_package_checksum: sha256:452cc850e021539c14359d016aba18ddba128f59aa9ab637738296d9b5cd78a0 zun_kata_package_checksum: sha256:452cc850e021539c14359d016aba18ddba128f59aa9ab637738296d9b5cd78a0
zun_kata_enabled: "True" zun_kata_enabled: "True"
@ -124,7 +130,11 @@ zun_docker_prune_frequency: hour
## Database info ## Database info
zun_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}" zun_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
zun_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((zun_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" zun_db_setup_python_interpreter: >-
{{
openstack_db_setup_python_interpreter | default((zun_db_setup_host == 'localhost') | ternary(
ansible_playbook_python, ansible_facts['python']['executable']))
}}
zun_galera_address: "{{ galera_address | default('127.0.0.1') }}" zun_galera_address: "{{ galera_address | default('127.0.0.1') }}"
zun_galera_user: zun zun_galera_user: zun
zun_galera_database: zun zun_galera_database: zun
@ -173,7 +183,7 @@ zun_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_
zun_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}" zun_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}"
# If this is not set, then the playbook will try to guess it. # If this is not set, then the playbook will try to guess it.
#zun_virt_type: kvm # zun_virt_type: kvm
## Zun Auth ## Zun Auth
zun_service_region: "{{ service_region | default('RegionOne') }}" zun_service_region: "{{ service_region | default('RegionOne') }}"
@ -242,7 +252,8 @@ zun_container_runtime: runc
## Cap the maximun number of threads / workers when a user value is unspecified. ## Cap the maximun number of threads / workers when a user value is unspecified.
zun_api_threads_max: 16 zun_api_threads_max: 16
zun_api_threads: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, zun_api_threads_max] | min }}" zun_api_threads: >-
{{ [[(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2, zun_api_threads_max] | min }}
zun_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}" zun_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
@ -255,7 +266,7 @@ zun_scheduler_driver: filter_scheduler
## uWSGI setup ## uWSGI setup
zun_wsgi_threads: 1 zun_wsgi_threads: 1
zun_wsgi_processes_max: 16 zun_wsgi_processes_max: 16
zun_wsgi_processes: "{{ [[ansible_facts['processor_vcpus']|default(1), 1] | max * 2, zun_wsgi_processes_max] | min }}" zun_wsgi_processes: "{{ [[ansible_facts['processor_vcpus'] | default(1), 1] | max * 2, zun_wsgi_processes_max] | min }}"
## Service Name-Group Mapping ## Service Name-Group Mapping
zun_services: zun_services:
@ -307,7 +318,7 @@ zun_services:
state: started state: started
options: options:
OnBootSec: 30min OnBootSec: 30min
OnCalendar: "{{ (zun_docker_prune_frequency == 'day') | ternary('daily', zun_docker_prune_frequency+'ly') }}" OnCalendar: "{{ (zun_docker_prune_frequency == 'day') | ternary('daily', zun_docker_prune_frequency + 'ly') }}"
Persistent: true Persistent: true
docker: docker:
group: zun_compute group: zun_compute
@ -379,7 +390,7 @@ zun_docker_init_defaults:
Service: Service:
ExecStart: ExecStart:
- "" - ""
- "/usr/bin/dockerd --group {{ zun_system_group_name }} -H tcp://{{ zun_docker_bind_host }}:{{ zun_docker_bind_port }} -H unix:///var/run/docker.sock --cluster-store {{ zun_docker_kv_storage }}://{% for item in groups[zun_docker_kv_group] %}{{ hostvars[item]['management_address'] }}:{{ zun_docker_kv_port }}{% if not loop.last %},{% endif %}{% endfor %}{% if zun_kata_enabled %} --add-runtime kata=/opt/kata/bin/kata-runtime{% endif %}" - "/usr/bin/dockerd --group {{ zun_system_group_name }} -H tcp://{{ zun_docker_bind_host }}:{{ zun_docker_bind_port }} -H unix:///var/run/docker.sock --cluster-store {{ zun_docker_kv_storage }}://{% for item in groups[zun_docker_kv_group] %}{{ hostvars[item]['management_address'] }}:{{ zun_docker_kv_port }}{% if not loop.last %},{% endif %}{% endfor %}{% if zun_kata_enabled %} --add-runtime kata=/opt/kata/bin/kata-runtime{% endif %}" # noqa: yaml[line-length]
## Tunable overrides for service unit files. ## Tunable overrides for service unit files.
zun_api_paste_ini_overrides: {} zun_api_paste_ini_overrides: {}
@ -436,5 +447,5 @@ zun_pki_install_certificates:
mode: "0600" mode: "0600"
# Define user-provided SSL certificates # Define user-provided SSL certificates
#zun_user_ssl_cert: <path to cert on ansible deployment host> # zun_user_ssl_cert: <path to cert on ansible deployment host>
#zun_user_ssl_key: <path to cert on ansible deployment host> # zun_user_ssl_key: <path to cert on ansible deployment host>

View File

@ -18,22 +18,23 @@ galaxy_info:
description: Installation and setup of zun description: Installation and setup of zun
company: Rackspace company: Rackspace
license: Apache2 license: Apache2
min_ansible_version: 2.4 role_name: os_zun
namespace: openstack
min_ansible_version: "2.10"
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- buster - bullseye
- name: Ubuntu - name: Ubuntu
versions: versions:
- focal - focal
- jammy
- name: EL - name: EL
versions: versions:
- 8 - "9"
categories: galaxy_tags:
- cloud - cloud
- python - python
- zun - zun
- development - development
- openstack - openstack
dependencies:
- apt_package_pinning

View File

@ -29,7 +29,8 @@
tags: tags:
- always - always
- import_tasks: zun_pre_install.yml - name: Importing zun_pre_install tasks
import_tasks: zun_pre_install.yml
tags: tags:
- zun-install - zun-install
@ -81,7 +82,8 @@
tags: tags:
- zun-install - zun-install
- include_role: - name: Including osa.mq_setup role
include_role:
name: openstack.osa.mq_setup name: openstack.osa.mq_setup
apply: apply:
tags: tags:
@ -105,7 +107,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:
@ -127,7 +130,8 @@
tags: tags:
- always - always
- include_role: - name: Including osa.service_setup role
include_role:
name: openstack.osa.service_setup name: openstack.osa.service_setup
apply: apply:
tags: tags:
@ -167,13 +171,15 @@
tags: tags:
- always - always
- import_tasks: zun_compute.yml - name: Importing zun_post_install tasks
import_tasks: zun_compute.yml
when: when:
- "zun_services['zun-compute']['group'] in group_names" - "zun_services['zun-compute']['group'] in group_names"
tags: tags:
- zun-compute - zun-compute
- import_tasks: zun_post_install.yml - name: Importing zun_post_install tasks
import_tasks: zun_post_install.yml
tags: tags:
- zun-config - zun-config
@ -196,10 +202,10 @@
systemd_tempd_prefix: openstack systemd_tempd_prefix: openstack
systemd_slice_name: "{{ zun_system_slice_name }}" systemd_slice_name: "{{ zun_system_slice_name }}"
systemd_lock_dir: "{{ zun_lock_dir }}" systemd_lock_dir: "{{ zun_lock_dir }}"
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_zun_services }}" systemd_services: "{{ filtered_zun_services }}"
tags: tags:
- zun-config - zun-config

View File

@ -36,7 +36,7 @@
get_url: get_url:
url: "{{ item.gpg_uri }}" url: "{{ item.gpg_uri }}"
dest: "/tmp/{{ item.name }}" dest: "/tmp/{{ item.name }}"
mode: 0440 mode: "0440"
with_items: "{{ zun_docker_repo }}" with_items: "{{ zun_docker_repo }}"
- name: Add Apt signing key on remote server to keyring - name: Add Apt signing key on remote server to keyring
@ -314,6 +314,7 @@
file: file:
path: "/var/tmp/zun-docker-cleanup.disabled" path: "/var/tmp/zun-docker-cleanup.disabled"
state: "{{ zun_docker_prune_images | ternary('absent', 'touch') }}" state: "{{ zun_docker_prune_images | ternary('absent', 'touch') }}"
mode: "0644"
- name: Remove legacy systemd docker override - name: Remove legacy systemd docker override
file: file:

View File

@ -13,7 +13,7 @@
# 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.
- name: create the system group - name: Create the system group
group: group:
name: "{{ zun_system_group_name }}" name: "{{ zun_system_group_name }}"
gid: "{{ zun_system_group_gid | default(omit) }}" gid: "{{ zun_system_group_gid | default(omit) }}"

View File

@ -18,7 +18,9 @@ _zun_containerd_package_version: "1.6.20-1"
zun_docker_repo: zun_docker_repo:
- name: "docker-ce" - name: "docker-ce"
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] | lower }} stable" repo: >-
deb [arch=amd64] https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }} {{
ansible_facts['distribution_release'] | lower }} stable
gpg_uri: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg" gpg_uri: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
# Common apt packages # Common apt packages