From ca5f36082ec98be0dd5cf85b663889cf078b2b1b Mon Sep 17 00:00:00 2001 From: Marc Gariepy Date: Fri, 4 Nov 2016 14:36:45 -0400 Subject: [PATCH] Fix tmpfiles.d when multiple service are running This fix tmpfile when multiple services runs in the same host with systemd. Change-Id: I2291e029e3d875408a81041a41d21042a3660e29 --- defaults/main.yml | 2 ++ tasks/cinder_init_systemd.yml | 6 +++--- ...nder-systemd-tempfiles.j2 => cinder-systemd-tmpfiles.j2} | 1 + templates/cinder.conf.j2 | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) rename templates/{cinder-systemd-tempfiles.j2 => cinder-systemd-tmpfiles.j2} (72%) diff --git a/defaults/main.yml b/defaults/main.yml index 856a5753..fee2de9a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -72,6 +72,8 @@ cinder_system_comment: cinder system user cinder_system_shell: /bin/false cinder_system_home_folder: "/var/lib/{{ cinder_system_user_name }}" +cinder_lock_path: /var/lock/cinder + ## Cinder Auth cinder_service_admin_tenant_name: "service" cinder_service_admin_username: "cinder" diff --git a/tasks/cinder_init_systemd.yml b/tasks/cinder_init_systemd.yml index 9441c500..7310e7d0 100644 --- a/tasks/cinder_init_systemd.yml +++ b/tasks/cinder_init_systemd.yml @@ -38,10 +38,10 @@ - inventory_hostname in groups[item.value.group] - "{{ item.value.condition | default(true) }}" -- name: Create tempfile.d entry +- name: Create tmpfiles.d entry template: - src: "cinder-systemd-tempfiles.j2" - dest: "/etc/tmpfiles.d/cinder.conf" + src: "cinder-systemd-tmpfiles.j2" + dest: "/etc/tmpfiles.d/{{ item.value.service_name }}.conf" mode: "0644" owner: "root" group: "root" diff --git a/templates/cinder-systemd-tempfiles.j2 b/templates/cinder-systemd-tmpfiles.j2 similarity index 72% rename from templates/cinder-systemd-tempfiles.j2 rename to templates/cinder-systemd-tmpfiles.j2 index b8ba6c28..e6affcaa 100644 --- a/templates/cinder-systemd-tempfiles.j2 +++ b/templates/cinder-systemd-tmpfiles.j2 @@ -2,3 +2,4 @@ D /var/lock/{{ item.value.service_name }} 2755 {{ cinder_system_user_name }} {{ cinder_system_group_name }} D /var/run/{{ item.value.service_name }} 2755 {{ cinder_system_user_name }} {{ cinder_system_group_name }} +D {{ cinder_lock_path }} 2755 {{ cinder_system_user_name }} {{ cinder_system_group_name }} diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index 25b92b62..3857e8b5 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -122,7 +122,7 @@ transport_url = rabbit://{% for host in cinder_rabbitmq_telemetry_servers.split( {% endif %} [oslo_concurrency] -lock_path = /var/lock/cinder +lock_path = {{ cinder_lock_path }} [profiler] profiler_enabled = {{ cinder_profiler_enabled }}