mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-23 05:01:04 +01:00
Finished storage-optimizer draft
This commit is contained in:
parent
71b76f2b35
commit
905b8b5e71
@ -92,6 +92,7 @@ system_maintenance_cleanup_services:
|
|||||||
system_maintenance_manipulation_services:
|
system_maintenance_manipulation_services:
|
||||||
- "heal-docker"
|
- "heal-docker"
|
||||||
- "update-docker"
|
- "update-docker"
|
||||||
|
- "storage-optimizer"
|
||||||
|
|
||||||
## Total System Maintenance Services
|
## Total System Maintenance Services
|
||||||
system_maintenance_services: "{{ system_maintenance_backup_services + system_maintenance_cleanup_services + system_maintenance_manipulation_services }}"
|
system_maintenance_services: "{{ system_maintenance_backup_services + system_maintenance_cleanup_services + system_maintenance_manipulation_services }}"
|
||||||
|
@ -45,4 +45,7 @@ pixelfed_database_password: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
|||||||
pixelfed_app_key: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
pixelfed_app_key: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
||||||
wordpress_database_password: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
wordpress_database_password: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
||||||
yourls_database_password: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
yourls_database_password: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
||||||
yourls_user_password: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
yourls_user_password: "I_NEED_TO_CHANGE_THIS_UNSECURE_PASSWORD"
|
||||||
|
|
||||||
|
path_mass_storage: "/mnt/hdd/"
|
||||||
|
path_rapid_storage: "/mnt/ssd/"
|
@ -2,10 +2,3 @@
|
|||||||
systemd:
|
systemd:
|
||||||
name: backup-remote-to-local.cymais.service
|
name: backup-remote-to-local.cymais.service
|
||||||
daemon_reload: yes
|
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"
|
Loading…
Reference in New Issue
Block a user