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

18 lines
574 B
YAML

---
- name: "daemon_reload : {{ services_service_name }} : set variables"
ansible.builtin.include_vars: "user.yml"
- name: "daemon_reload : {{ services_service_name }} : check if user exists"
ansible.builtin.getent:
database: "passwd"
key: "{{ services_service_user_name }}"
fail_key: false
- name: "daemon_reload : {{ services_service_name }} : systemd daemon reload"
become_user: "{{ services_service_user_name }}"
ansible.builtin.systemd:
daemon_reload: true
scope: "user"
when:
ansible_facts.getent_passwd[services_service_user_name]