mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Finished storage-optimizer draft
This commit is contained in:
@@ -2,10 +2,3 @@
|
||||
systemd:
|
||||
name: backup-remote-to-local.cymais.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "restart backup-remote-to-local timer"
|
||||
systemd:
|
||||
name: backup-remote-to-local.cymais.timer
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
4
roles/storage-optimizer/handlers/main.yml
Normal file
4
roles/storage-optimizer/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: "reload storage-optimizer service"
|
||||
systemd:
|
||||
name: storage-optimizer.cymais.service
|
||||
daemon_reload: yes
|
18
roles/storage-optimizer/tasks/main.yml
Normal file
18
roles/storage-optimizer/tasks/main.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
- name: "create {{storage_optimizer_directory}}"
|
||||
file:
|
||||
path: "{{storage_optimizer_directory}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: create storage-optimizer.cymais.service
|
||||
template:
|
||||
src: storage-optimizer.service.j2
|
||||
dest: /etc/systemd/system/storage-optimizer.cymais.service
|
||||
notify: reload storage-optimizer service
|
||||
|
||||
- name: create storage-optimizer.py
|
||||
template:
|
||||
src: storage-optimizer.py.j2
|
||||
dest: "{{storage_optimizer_script}}"
|
||||
mode: 0755
|
||||
notify: reload storage-optimizer service
|
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Optimize storage paths
|
||||
OnFailure=systemd-notifier.cymais@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{system_maintenance_backup_services| join(' ') }}'
|
||||
ExecStart=/bin/sh -c '/usr/bin/python {{storage_optimizer_script}} --rapid-storage-path {{rapid_mass_storage}} --mass-storage-path {{path_mass_storage}}'
|
2
roles/storage-optimizer/vars/main.yml
Normal file
2
roles/storage-optimizer/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
storage_optimizer_directory: "{{path_administrator_scripts}}storage-optimizer/"
|
||||
storage_optimizer_script: "{{storage_optimizer_directory}}storage-optimizer.py"
|
Reference in New Issue
Block a user