From 93ef742841393607a69a9b7da466654fb4c816e7 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 30 Nov 2021 12:18:27 +0200 Subject: [PATCH] Refactor definition of lock path Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819300 Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/819298 Change-Id: If5622f736e17f0f187a0740d60ea435d03a131bb --- defaults/main.yml | 3 ++- tasks/main.yml | 4 ++-- tasks/nova_pre_install.yml | 4 ---- templates/nova.conf.j2 | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index a89bba50..785577e4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -66,9 +66,10 @@ nova_system_group_name: nova nova_system_shell: /bin/bash nova_system_comment: nova system user nova_system_home_folder: "/var/lib/{{ nova_system_user_name }}" +nova_system_slice_name: nova nova_libvirt_save_path: "{{ nova_system_home_folder }}/save" -nova_lock_path: "/var/lock/nova" +nova_lock_dir: "{{ openstack_lock_dir | default('/run/lock') }}" nova_management_address: "127.0.0.1" diff --git a/tasks/main.yml b/tasks/main.yml index b44bd531..fe2d319c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -210,8 +210,8 @@ systemd_user_name: "{{ nova_system_user_name }}" systemd_group_name: "{{ nova_system_group_name }}" systemd_tempd_prefix: openstack - systemd_slice_name: nova - systemd_lock_path: /var/lock/nova + systemd_slice_name: "{{ nova_system_slice_name }}" + systemd_lock_dir: "{{ nova_lock_dir }}" systemd_CPUAccounting: true systemd_BlockIOAccounting: true systemd_MemoryAccounting: true diff --git a/tasks/nova_pre_install.yml b/tasks/nova_pre_install.yml index cee1f1ce..279d17b1 100644 --- a/tasks/nova_pre_install.yml +++ b/tasks/nova_pre_install.yml @@ -112,15 +112,11 @@ mode: "0750" owner: "root" group: "root" - - path: "/var/cache/nova" - path: "{{ nova_system_home_folder }}" - path: "{{ nova_system_home_folder }}/.ssh" mode: "0700" - path: "{{ nova_system_home_folder }}/cache/api" - path: "{{ nova_system_home_folder }}/instances" - - path: "{{ nova_lock_path }}" - mode: "2755" - - path: "/var/run/nova" tags: - nova-dirs diff --git a/templates/nova.conf.j2 b/templates/nova.conf.j2 index d536fbdc..540b4190 100644 --- a/templates/nova.conf.j2 +++ b/templates/nova.conf.j2 @@ -209,7 +209,7 @@ pool_timeout = {{ nova_api_db_pool_timeout }} {% endif %} [oslo_concurrency] -lock_path = {{ nova_lock_path }} +lock_path = {{ nova_lock_dir }}/{{ nova_system_slice_name }} {% if nova_virt_type == 'ironic' %}