ansible-edda/playbooks/roles/services/include/tasks/daemon_reload/main.yml

18 lines
574 B
YAML
Raw Normal View History

2022-12-18 23:43:40 +01:00
---
2022-12-10 21:39:04 +01:00
- name: "daemon_reload : {{ services_service_name }} : set variables"
2023-01-04 07:52:21 +01:00
ansible.builtin.include_vars: "user.yml"
2022-12-10 21:39:04 +01:00
2023-01-04 07:52:21 +01:00
- name: "daemon_reload : {{ services_service_name }} : check if user exists"
ansible.builtin.getent:
database: "passwd"
key: "{{ services_service_user_name }}"
fail_key: false
2022-12-10 21:39:04 +01:00
- name: "daemon_reload : {{ services_service_name }} : systemd daemon reload"
become_user: "{{ services_service_user_name }}"
ansible.builtin.systemd:
daemon_reload: true
scope: "user"
when:
2023-01-04 07:52:21 +01:00
ansible_facts.getent_passwd[services_service_user_name]