Use slice name for lock/run by default

Change-Id: I883d6520e7da4491929252677193f733808da6a3
This commit is contained in:
Dmitriy Rabotyagov 2021-11-25 13:54:58 +02:00
parent a3800b6368
commit fc698fb11a
3 changed files with 6 additions and 6 deletions

View File

@ -119,8 +119,8 @@ systemd_environment: {}
# will be used to generate systemd overrides in /etc/systemd/system/service_name.service.d/overrides.conf
# `systemd_overrides_only` -- (optional) Boolean variable, when True no service_name.service will be generated and role
# will place only overrides for the existing service.
# `systemd_run_dir` -- (optional) Run directory that will be used for service runtime. Service name is added to the path
# `systemd_lock_dir` -- (optional) Lock directory that will be used for service runtime. Service name is added to the path
# `systemd_run_dir` -- (optional) Run directory that will be used for service runtime. Service slice or name is added to the path
# `systemd_lock_dir` -- (optional) Lock directory that will be used for service runtime. Service slice or name is added to the path
# Under the service dictionary the "sockets" key can be added, which may contain list of the sockets
# for the given service_name. Each socket in the lsit may have following structure:

View File

@ -30,7 +30,7 @@
- name: Create TEMP run dir
file:
path: "{{ item.systemd_run_dir | default(systemd_run_dir) }}/{{ item.service_name | replace(' ', '_') }}"
path: "{{ item.systemd_run_dir | default(systemd_run_dir) }}/{{ item.systemd_slice_name | default(systemd_slice_name) | replace(' ', '_') }}"
state: directory
owner: "{{ item.systemd_user_name | default(systemd_user_name) }}"
group: "{{ item.systemd_group_name | default(systemd_group_name) }}"
@ -41,7 +41,7 @@
- name: Create TEMP service lock dir
file:
path: "{{ item.systemd_lock_dir | default(systemd_lock_dir) }}/{{ item.service_name | replace(' ', '_') }}"
path: "{{ item.systemd_lock_dir | default(systemd_lock_dir) }}/{{ item.systemd_slice_name | default(systemd_slice_name) | replace(' ', '_') }}"
state: directory
owner: "{{ item.systemd_user_name | default(systemd_user_name) }}"
group: "{{ item.systemd_group_name | default(systemd_group_name) }}"

View File

@ -1,4 +1,4 @@
# {{ ansible_managed }}
D {{ item.systemd_lock_dir | default(systemd_lock_dir) }}/{{ item.service_name | replace(' ', '_') }} 2755 {{ item.systemd_user_name | default(systemd_user_name) }} {{ item.systemd_group_name | default(systemd_group_name) }}
D {{ item.systemd_run_dir | default(systemd_run_dir) }}/{{ item.service_name | replace(' ', '_') }} 2755 {{ item.systemd_user_name | default(systemd_user_name) }} {{ item.systemd_group_name | default(systemd_group_name) }}
D {{ item.systemd_lock_dir | default(systemd_lock_dir) }}/{{ item.systemd_slice_name | default(systemd_slice_name) | replace(' ', '_') }} 2755 {{ item.systemd_user_name | default(systemd_user_name) }} {{ item.systemd_group_name | default(systemd_group_name) }}
D {{ item.systemd_run_dir | default(systemd_run_dir) }}/{{ item.systemd_slice_name | default(systemd_slice_name) | replace(' ', '_') }} 2755 {{ item.systemd_user_name | default(systemd_user_name) }} {{ item.systemd_group_name | default(systemd_group_name) }}