Browse Source

systemd check

master
Bastiaan Stroosnijder 5 months ago
parent
commit
a90dacdcd9
  1. 1
      handlers/main.yml
  2. 2
      handlers/start.yml
  3. 1
      tasks/add-user.yml

1
handlers/main.yml

@ -1,6 +1,7 @@
---
- name: restart_openssh
when: ansible_service_mgr == 'systemd'
ansible.builtin.systemd:
name: "{{ pilab_openssh_service }}"
state: restarted

2
handlers/start.yml

@ -186,6 +186,7 @@
dest: "{{ pilab_users_path_systemd[pilab_services_user[_service_name]] }}/{{ pilab_services_service[_service_name] }}"
- name: Ensure Services are Stopped
when: ansible_service_mgr == 'systemd'
loop: "{{ pilab_services_instances | default({}) | dict2items | map(attribute='value') | flatten(1) | unique }}"
loop_control:
loop_var: _instance_name
@ -202,6 +203,7 @@
scope: user
- name: Ensure Services are Started
when: ansible_service_mgr == 'systemd'
loop: "{{ pilab_services_instances | default({}) | dict2items | map(attribute='value') | flatten(1) | unique }}"
loop_control:
loop_var: _instance_name

1
tasks/add-user.yml

@ -56,6 +56,7 @@
state: directory
- name: Ensure User is allowed to Linger
when: ansible_service_mgr == 'systemd'
ansible.builtin.command:
cmd: "{{ pilab_exec_loginctl }} enable-linger {{ _user_name }}"
creates: "{{ _user_path_linger }}"

Loading…
Cancel
Save