39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
# Simple predefined tasks registry
|
|
# key -> metadata (label, command template, description)
|
|
# Command template can use {param} formatting; future extension with parameters
|
|
|
|
TASKS = {
|
|
'deploy_app': {
|
|
'label': 'Deploy App',
|
|
'command': 'cd /srv/app && ./deploy.sh',
|
|
'description': 'Run application deployment script.'
|
|
},
|
|
'restart_ssh': {
|
|
'label': 'Restart SSH Service',
|
|
'command': 'sudo systemctl restart ssh',
|
|
'description': 'Restart the SSH daemon.'
|
|
},
|
|
'status_app': {
|
|
'label': 'status App',
|
|
'command': 'sudo systemctl status pipeline@pyapp-dali',
|
|
'description': 'Run status.'
|
|
},
|
|
'start_app': {
|
|
'label': 'start App',
|
|
'command': 'sudo systemctl start pipeline@pyapp-dali',
|
|
'description': 'Run start application '
|
|
},
|
|
'stop_app': {
|
|
'label': 'stop App',
|
|
'command': 'sudo systemctl stop pipeline@pyapp-dali',
|
|
'description': 'Run stop application '
|
|
},
|
|
|
|
}
|
|
|
|
def list_tasks():
|
|
return TASKS
|
|
|
|
def get_task(key: str):
|
|
return TASKS.get(key)
|