From e29b04d378e34c349fa96dd4495334cdbf70b8d0 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 15 Dec 2023 15:27:09 +0100 Subject: [PATCH] Removed headlock(hopefully) --- group_vars/all | 2 +- .../files/system-maintenance-service-freezer.py | 2 +- .../templates/system-maintenance-service-freezer.service.j2 | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/group_vars/all b/group_vars/all index 838bd783..b2255f9a 100644 --- a/group_vars/all +++ b/group_vars/all @@ -58,7 +58,7 @@ system_maintenance_timeout_cleanup_services: "15min" system_maintenance_timeout_backup_services: "1h" system_maintenance_timeout_heal_docker: "30min" system_maintenance_timeout_update_docker: "5min" -system_maintenance_timeout_defroster: "2min" +system_maintenance_timeout_freezer_action: "2min" ## Services diff --git a/roles/system-maintenance-service-freezer/files/system-maintenance-service-freezer.py b/roles/system-maintenance-service-freezer/files/system-maintenance-service-freezer.py index f3efc2d9..764033d1 100644 --- a/roles/system-maintenance-service-freezer/files/system-maintenance-service-freezer.py +++ b/roles/system-maintenance-service-freezer/files/system-maintenance-service-freezer.py @@ -179,7 +179,7 @@ if __name__ == "__main__": parser.add_argument('action', choices=['freeze', 'defrost'], help='Action to perform: freeze or defrost services.') parser.add_argument('services', nargs='+', help='List of services to apply the action to.') parser.add_argument('--ignore', nargs='*', help='List of services to ignore in the action.', default=[]) - parser.add_argument('--timeout', help='Timeout for freezing services (e.g., 1h, 30min, 45s).', default='1h') + parser.add_argument('--timeout', help='Timeout for freezer actions (e.g., 1h, 30min, 45s).', default='1min') args = parser.parse_args() services = args.services ignored_services = args.ignore if args.ignore else [] diff --git a/roles/system-maintenance-service-freezer/templates/system-maintenance-service-freezer.service.j2 b/roles/system-maintenance-service-freezer/templates/system-maintenance-service-freezer.service.j2 index 22633f4f..aaa4e68b 100644 --- a/roles/system-maintenance-service-freezer/templates/system-maintenance-service-freezer.service.j2 +++ b/roles/system-maintenance-service-freezer/templates/system-maintenance-service-freezer.service.j2 @@ -4,5 +4,4 @@ OnFailure=systemd-notifier@%n.service [Service] Type=oneshot -ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_maintenance_service_freezer_script }} {{item}} {{ system_maintenance_services | join(' ') }} --timeout "{{system_maintenance_timeout_defroster}}"' -ExecStart=/bin/sh -c '/usr/bin/python {{ path_system_maintenance_service_freezer_script }} {{item}} {{ system_maintenance_services | join(' ') }}' \ No newline at end of file +ExecStart=/bin/sh -c '/usr/bin/python {{ path_system_maintenance_service_freezer_script }} {{item}} {{ system_maintenance_services | join(' ') }} --timeout "{{system_maintenance_timeout_freezer_action}}"' \ No newline at end of file