diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-08-23 18:06:40 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-08-23 18:11:44 +0200 |
commit | 622921151674a71fda88b405a576847e69cd3c83 (patch) | |
tree | 403cdfc0f6350174e138750ba2706bd67f77e652 /roles/systemd_depend_iface/tasks/main.yml | |
parent | replace systemd_requires_mounts_for with systemd_depend_mount (diff) | |
download | infra-ansible-622921151674a71fda88b405a576847e69cd3c83.tar.gz infra-ansible-622921151674a71fda88b405a576847e69cd3c83.zip |
add role systemd_depend_iface
Diffstat (limited to '')
-rw-r--r-- | roles/systemd_depend_iface/tasks/main.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/systemd_depend_iface/tasks/main.yml b/roles/systemd_depend_iface/tasks/main.yml new file mode 100644 index 0000000..1bc8590 --- /dev/null +++ b/roles/systemd_depend_iface/tasks/main.yml @@ -0,0 +1,28 @@ +- name: Create override directory + become: true + ansible.builtin.file: + path: '/etc/systemd/system/{{ service }}.service.d' + state: directory + owner: root + group: root + mode: '755' + loop: '{{ systemd_depend_iface_services }}' + loop_control: + loop_var: service + +- name: Create service override + become: true + ansible.builtin.template: + src: override.conf.j2 + dest: '/etc/systemd/system/{{ service }}.service.d/depend_iface_{{ systemd_depend_iface_name }}.conf' + owner: root + group: root + mode: '644' + register: systemd_depend_iface_result + notify: systemd_depend_iface_restart + loop: '{{ systemd_depend_iface_services }}' + loop_control: + loop_var: service + +- name: Restart systemd services if necessary + ansible.builtin.meta: flush_handlers |