mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-18 06:24:25 +02:00
Moved sys-opt-ssd-hdd to a callable version in svc-opt-ssd-hdd
This commit is contained in:
parent
f2187e4bc0
commit
c09dec8b0f
2
Makefile
2
Makefile
@ -27,7 +27,7 @@ clean:
|
|||||||
|
|
||||||
tree:
|
tree:
|
||||||
@echo Generating Tree
|
@echo Generating Tree
|
||||||
python3 main.py generate tree -L 1
|
python3 main.py generate tree -D 2 --no-signal
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@echo "🔧 Generating users defaults → $(USERS_OUT)…"
|
@echo "🔧 Generating users defaults → $(USERS_OUT)…"
|
||||||
|
@ -28,7 +28,7 @@ system_maintenance_cleanup_services:
|
|||||||
system_maintenance_manipulation_services:
|
system_maintenance_manipulation_services:
|
||||||
- "sys-rpr-docker-soft"
|
- "sys-rpr-docker-soft"
|
||||||
- "update-docker"
|
- "update-docker"
|
||||||
- "sys-opt-ssd-hdd"
|
- "svc-opt-ssd-hdd"
|
||||||
- "sys-rpr-docker-hard"
|
- "sys-rpr-docker-hard"
|
||||||
|
|
||||||
## Total System Maintenance Services
|
## Total System Maintenance Services
|
||||||
|
@ -4,6 +4,7 @@ roles:
|
|||||||
invokable: false
|
invokable: false
|
||||||
sys:
|
sys:
|
||||||
title: "System"
|
title: "System"
|
||||||
|
description: "System near components. Will be automaticly called if necessary from other roles."
|
||||||
invokable: false
|
invokable: false
|
||||||
alm:
|
alm:
|
||||||
title: "Alerting"
|
title: "Alerting"
|
||||||
@ -104,6 +105,12 @@ roles:
|
|||||||
description: "Docker infrastructure services (DBMS, LDAP, Redis, etc.)"
|
description: "Docker infrastructure services (DBMS, LDAP, Redis, etc.)"
|
||||||
icon: "fas fa-database"
|
icon: "fas fa-database"
|
||||||
invokable: true
|
invokable: true
|
||||||
|
opt:
|
||||||
|
title: "Service Optimation"
|
||||||
|
description: "Optimation Services to improve your system"
|
||||||
|
icon: "fas fa-database"
|
||||||
|
invokable: true
|
||||||
|
|
||||||
user:
|
user:
|
||||||
title: "Users & Access"
|
title: "Users & Access"
|
||||||
description: "User accounts & access control"
|
description: "User accounts & access control"
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
group: administrator
|
group: administrator
|
||||||
when: run_once_docker is not defined
|
when: run_once_docker is not defined
|
||||||
|
|
||||||
- name: Set docker_enabled to true, to activate sys-opt-ssd-hdd
|
- name: Set docker_enabled to true, to activate svc-opt-ssd-hdd
|
||||||
set_fact:
|
set_fact:
|
||||||
docker_enabled: true
|
docker_enabled: true
|
||||||
when: run_once_docker is not defined
|
when: run_once_docker is not defined
|
||||||
|
5
roles/svc-opt-ssd-hdd/handlers/main.yml
Normal file
5
roles/svc-opt-ssd-hdd/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload svc-opt-ssd-hdd.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: svc-opt-ssd-hdd.cymais.service
|
||||||
|
state: reloaded
|
||||||
|
daemon_reload: yes
|
22
roles/svc-opt-ssd-hdd/tasks/main.yml
Normal file
22
roles/svc-opt-ssd-hdd/tasks/main.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
- name: "create {{storage_optimizer_directory}}"
|
||||||
|
file:
|
||||||
|
path: "{{storage_optimizer_directory}}"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: create svc-opt-ssd-hdd.cymais.service
|
||||||
|
template:
|
||||||
|
src: svc-opt-ssd-hdd.service.j2
|
||||||
|
dest: /etc/systemd/system/svc-opt-ssd-hdd.cymais.service
|
||||||
|
notify: reload svc-opt-ssd-hdd.cymais.service
|
||||||
|
|
||||||
|
- name: create svc-opt-ssd-hdd.py
|
||||||
|
copy:
|
||||||
|
src: svc-opt-ssd-hdd.py
|
||||||
|
dest: "{{storage_optimizer_script}}"
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: "optimize storage performance"
|
||||||
|
systemd:
|
||||||
|
name: svc-opt-ssd-hdd.cymais.service
|
||||||
|
state: started
|
@ -4,5 +4,5 @@ OnFailure=sys-alm-compose.cymais@%n.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore sys-opt-ssd-hdd svc-sys-bkp-rmt-2-loc --timeout "{{system_maintenance_lock_timeout_storage_optimizer}}"'
|
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore svc-opt-ssd-hdd svc-sys-bkp-rmt-2-loc --timeout "{{system_maintenance_lock_timeout_storage_optimizer}}"'
|
||||||
ExecStart=/bin/sh -c '/usr/bin/python {{storage_optimizer_script}} --rapid-storage-path {{path_rapid_storage}} --mass-storage-path {{path_mass_storage}}'
|
ExecStart=/bin/sh -c '/usr/bin/python {{storage_optimizer_script}} --rapid-storage-path {{path_rapid_storage}} --mass-storage-path {{path_mass_storage}}'
|
3
roles/svc-opt-ssd-hdd/vars/main.yml
Normal file
3
roles/svc-opt-ssd-hdd/vars/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
storage_optimizer_directory: '{{path_administrator_scripts}}svc-opt-ssd-hdd/'
|
||||||
|
storage_optimizer_script: '{{storage_optimizer_directory}}svc-opt-ssd-hdd.py'
|
||||||
|
application_id: svc-opt-ssd-hdd
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload sys-opt-ssd-hdd.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: sys-opt-ssd-hdd.cymais.service
|
|
||||||
state: reloaded
|
|
||||||
daemon_reload: yes
|
|
@ -1,22 +0,0 @@
|
|||||||
- name: "create {{storage_optimizer_directory}}"
|
|
||||||
file:
|
|
||||||
path: "{{storage_optimizer_directory}}"
|
|
||||||
state: directory
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
- name: create sys-opt-ssd-hdd.cymais.service
|
|
||||||
template:
|
|
||||||
src: sys-opt-ssd-hdd.service.j2
|
|
||||||
dest: /etc/systemd/system/sys-opt-ssd-hdd.cymais.service
|
|
||||||
notify: reload sys-opt-ssd-hdd.cymais.service
|
|
||||||
|
|
||||||
- name: create sys-opt-ssd-hdd.py
|
|
||||||
copy:
|
|
||||||
src: sys-opt-ssd-hdd.py
|
|
||||||
dest: "{{storage_optimizer_script}}"
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
- name: "optimize storage performance"
|
|
||||||
systemd:
|
|
||||||
name: sys-opt-ssd-hdd.cymais.service
|
|
||||||
state: started
|
|
@ -1,2 +0,0 @@
|
|||||||
storage_optimizer_directory: '{{path_administrator_scripts}}sys-opt-ssd-hdd/'
|
|
||||||
storage_optimizer_script: '{{storage_optimizer_directory}}sys-opt-ssd-hdd.py'
|
|
@ -1,6 +1,6 @@
|
|||||||
#- name: "Load destruction roles"
|
- name: "Load destruction roles"
|
||||||
# include_tasks: "./tasks/groups/{{ item }}-roles.yml"
|
include_tasks: "./tasks/groups/{{ item }}-roles.yml"
|
||||||
# loop:
|
loop:
|
||||||
# - cln
|
- svc-opt # Optimation services
|
||||||
# loop_control:
|
loop_control:
|
||||||
# label: "{{ item }}-roles.yml"
|
label: "{{ item }}-roles.yml"
|
@ -8,7 +8,7 @@ import sys
|
|||||||
def load_optimizer_module():
|
def load_optimizer_module():
|
||||||
module_path = os.path.abspath(os.path.join(
|
module_path = os.path.abspath(os.path.join(
|
||||||
os.path.dirname(__file__),
|
os.path.dirname(__file__),
|
||||||
'..', "..", "..","..",'roles', 'sys-opt-ssd-hdd', 'files', 'sys-opt-ssd-hdd.py'
|
'..', "..", "..","..",'roles', 'svc-opt-ssd-hdd', 'files', 'svc-opt-ssd-hdd.py'
|
||||||
))
|
))
|
||||||
spec = importlib.util.spec_from_file_location('storage_optimizer', module_path)
|
spec = importlib.util.spec_from_file_location('storage_optimizer', module_path)
|
||||||
optimizer = importlib.util.module_from_spec(spec)
|
optimizer = importlib.util.module_from_spec(spec)
|
Loading…
x
Reference in New Issue
Block a user