diff --git a/defaults/main.yml b/defaults/main.yml index f344021..73a6b9e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -72,11 +72,6 @@ systemd_run_dir: "/run" # This option can also be defined for specific service entries under "systemd_services". systemd_lock_dir: "/run/lock" -# Global lock path used for system services. -# This is an optional variable and will have no effect if undefined. -# This option can also be defined for specific service entries under "systemd_services". -# systemd_lock_path: "/var/lock/service1" - # Global Environment variables for system services. # This option will provide the operator a way to set additional environment options # used within the execution of a given service. Environment variables can be passed diff --git a/releasenotes/notes/deprecate_systemd_lock_path-fba3aff8b1b4468d.yaml b/releasenotes/notes/deprecate_systemd_lock_path-fba3aff8b1b4468d.yaml new file mode 100644 index 0000000..0f72e59 --- /dev/null +++ b/releasenotes/notes/deprecate_systemd_lock_path-fba3aff8b1b4468d.yaml @@ -0,0 +1,9 @@ +--- + +deprecations: + - | + Variable ``systemd_lock_path`` has been dropped and has no effect now. + In order to customize lock dir path please use ``systemd_lock_dir``. + Please keep in mind, that for ``systemd_lock_dir`` you don't need to + provide full path like it was with ``systemd_lock_path`` since service + name is added to the end of the path. diff --git a/tasks/main.yml b/tasks/main.yml index a0083ad..efbfa4b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -47,23 +47,6 @@ group: "{{ item.systemd_group_name | default(systemd_group_name) }}" mode: "02755" with_items: "{{ systemd_services }}" - when: - - (item.systemd_lock_path is not defined) and - (systemd_lock_path is not defined) - tags: - - systemd-service - -- name: Create TEMP defined lock path - file: - path: "{{ item.systemd_lock_path | default(systemd_lock_path) }}" - state: directory - owner: "{{ item.systemd_user_name | default(systemd_user_name) }}" - group: "{{ item.systemd_group_name | default(systemd_group_name) }}" - mode: "02755" - when: - - (item.systemd_lock_path is defined) or - (systemd_lock_path is defined) - with_items: "{{ systemd_services }}" tags: - systemd-service diff --git a/templates/systemd-tmpfiles.j2 b/templates/systemd-tmpfiles.j2 index 21bd066..efc2e8a 100644 --- a/templates/systemd-tmpfiles.j2 +++ b/templates/systemd-tmpfiles.j2 @@ -1,9 +1,4 @@ # {{ ansible_managed }} -{% if (item.systemd_lock_path is defined) or (systemd_lock_path is defined) %} -D {{ item.systemd_lock_path | default(systemd_lock_path) }} 2755 {{ item.systemd_user_name | default(systemd_user_name) }} {{ item.systemd_group_name | default(systemd_group_name) }} -D {{ (item.systemd_lock_path | default(systemd_lock_path)) | replace('lock', 'run') }} 2755 {{ item.systemd_user_name | default(systemd_user_name) }} {{ item.systemd_group_name | default(systemd_group_name) }} -{% else %} 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) }} -{% endif %} diff --git a/tests/test.yml b/tests/test.yml index 4b028fb..a391ca1 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -48,7 +48,6 @@ enabled: yes state: started systemd_tempd_prefix: openstack - systemd_lock_path: /var/lock/networking - service_name: "test timer service0" execstarts: - "/bin/bash -c 'echo start0'"