From cab4614094d653b06cbc41ee825007bcbd5c042e Mon Sep 17 00:00:00 2001 From: Marc Gariepy Date: Fri, 4 Nov 2016 15:10:14 -0400 Subject: [PATCH] Fix tmpfiles.d when multiple service are running This fix tmpfile when multiple services runs in the same host with systemd. Add ironic_lock_path vars to configure lock path Change-Id: I7c4b6a356b321c65718af3cc5b3818b7f9a61e58 --- defaults/main.yml | 1 + tasks/ironic_init_systemd.yml | 6 +++--- tasks/ironic_pre_install.yml | 2 +- ...onic-systemd-tempfiles.j2 => ironic-systemd-tmpfiles.j2} | 1 + templates/ironic.conf.j2 | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) rename templates/{ironic-systemd-tempfiles.j2 => ironic-systemd-tmpfiles.j2} (71%) diff --git a/defaults/main.yml b/defaults/main.yml index 9cc5eb0d..2287bae3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -43,6 +43,7 @@ ironic_system_shell: /bin/bash ironic_system_comment: ironic system user ironic_system_home_folder: "/var/lib/{{ ironic_system_user_name }}" ironic_system_log_folder: "/var/log/{{ ironic_system_user_name }}" +ironic_lock_path: /var/lock/ironic # Ironic Program and Service names ironic_api_program_name: apache2 diff --git a/tasks/ironic_init_systemd.yml b/tasks/ironic_init_systemd.yml index b7301545..c08e82a7 100644 --- a/tasks/ironic_init_systemd.yml +++ b/tasks/ironic_init_systemd.yml @@ -29,10 +29,10 @@ group: "{{ system_group }}" mode: "02755" -- name: Create tempfile.d entry +- name: Create tmpfiles.d entry template: - src: "ironic-systemd-tempfiles.j2" - dest: "/etc/tmpfiles.d/ironic.conf" + src: "ironic-systemd-tmpfiles.j2" + dest: "/etc/tmpfiles.d/{{ program_name }}.conf" mode: "0644" owner: "root" group: "root" diff --git a/tasks/ironic_pre_install.yml b/tasks/ironic_pre_install.yml index df00fcd9..510f2f3a 100644 --- a/tasks/ironic_pre_install.yml +++ b/tasks/ironic_pre_install.yml @@ -58,7 +58,7 @@ - { path: "{{ ironic_system_home_folder }}/images" } - { path: "{{ ironic_system_home_folder }}/master_images" } - { path: "{{ ironic_system_home_folder }}/cache/api", mode: "0700" } - - { path: "/var/lock/ironic" } + - { path: "{{ ironic_lock_path }}" } - { path: "/var/run/ironic" } - { path: "/var/www/cgi-bin", owner: root, group: root } - { path: "/var/www/cgi-bin/ironic" } diff --git a/templates/ironic-systemd-tempfiles.j2 b/templates/ironic-systemd-tmpfiles.j2 similarity index 71% rename from templates/ironic-systemd-tempfiles.j2 rename to templates/ironic-systemd-tmpfiles.j2 index b723d85d..1e580f5f 100644 --- a/templates/ironic-systemd-tempfiles.j2 +++ b/templates/ironic-systemd-tmpfiles.j2 @@ -2,3 +2,4 @@ D /var/lock/{{ program_name }} 2755 {{ system_user }} {{ system_group }} D /var/run/{{ program_name }} 2755 {{ system_user }} {{ system_group }} +D {{ ironic_lock_path }} 2755 {{ system_user }} {{ system_group }} diff --git a/templates/ironic.conf.j2 b/templates/ironic.conf.j2 index 6ba1102d..8c2e026d 100644 --- a/templates/ironic.conf.j2 +++ b/templates/ironic.conf.j2 @@ -118,7 +118,7 @@ insecure = {{ keystone_service_adminuri_insecure | bool }} [oneview] [oslo_concurrency] -lock_path = /var/lock/ironic +lock_path = {{ ironic_lock_path }} [oslo_messaging_amqp]