mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Moved sys-opt-ssd-hdd to a callable version in svc-opt-ssd-hdd
This commit is contained in:
@@ -4,6 +4,7 @@ roles:
|
||||
invokable: false
|
||||
sys:
|
||||
title: "System"
|
||||
description: "System near components. Will be automaticly called if necessary from other roles."
|
||||
invokable: false
|
||||
alm:
|
||||
title: "Alerting"
|
||||
@@ -104,6 +105,12 @@ roles:
|
||||
description: "Docker infrastructure services (DBMS, LDAP, Redis, etc.)"
|
||||
icon: "fas fa-database"
|
||||
invokable: true
|
||||
opt:
|
||||
title: "Service Optimation"
|
||||
description: "Optimation Services to improve your system"
|
||||
icon: "fas fa-database"
|
||||
invokable: true
|
||||
|
||||
user:
|
||||
title: "Users & Access"
|
||||
description: "User accounts & access control"
|
||||
|
@@ -16,7 +16,7 @@
|
||||
group: administrator
|
||||
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:
|
||||
docker_enabled: true
|
||||
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]
|
||||
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}}'
|
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'
|
Reference in New Issue
Block a user