mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
General optimations
This commit is contained in:
8
roles/core-daemon/tasks/main.yml
Normal file
8
roles/core-daemon/tasks/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
- name: "reset (if enabled)"
|
||||
include_tasks: reset.yml
|
||||
when: mode_reset | bool and run_once_core_daemon is not defined
|
||||
|
||||
- name: run {{ role_name }} once
|
||||
set_fact:
|
||||
run_once_core_daemon: true
|
||||
when: run_once_core_daemon is not defined
|
28
roles/core-daemon/tasks/reset.yml
Normal file
28
roles/core-daemon/tasks/reset.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
- name: Find all cymais.service units
|
||||
find:
|
||||
paths: /etc/systemd/system
|
||||
patterns: '*.cymais.service'
|
||||
register: cymais_services
|
||||
|
||||
- name: Disable and stop each cymais service
|
||||
become: true
|
||||
systemd:
|
||||
name: "{{ item.path | basename }}"
|
||||
enabled: no
|
||||
state: stopped
|
||||
loop: "{{ cymais_services.files }}"
|
||||
loop_control:
|
||||
label: "{{ item.path | basename }}"
|
||||
|
||||
- name: Remove all cymais.service files
|
||||
become: true
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
loop: "{{ cymais_services.files }}"
|
||||
loop_control:
|
||||
label: "{{ item.path | basename }}"
|
||||
|
||||
- name: Reload systemd daemon
|
||||
become: true
|
||||
command: systemctl daemon-reload
|
Reference in New Issue
Block a user