Mercurial > code > home > repos > infra
diff all_operations.py @ 326:5b88b38f2471
huge reorg, reog toplevel functions in preparation of a ui with nice task lists
author | drewp@bigasterisk.com |
---|---|
date | Mon, 20 Jan 2025 21:55:08 -0800 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all_operations.py Mon Jan 20 21:55:08 2025 -0800 @@ -0,0 +1,32 @@ +import importlib +import os +from pyinfra.context import host + + +def gatherFuncs(): + for opGroup in [ + 'users', + 'system', + 'apt', + 'packages', + 'net', + 'dns', + 'wireguard', + 'kube', + 'sync', + 'mail', + 'home', + ]: + if os.environ.get('GROUP') and opGroup != os.environ['GROUP']: + continue + mod = importlib.import_module(f'{opGroup}.{opGroup}') + operations = getattr(mod, 'operations') + for func in operations: + funcFullName = f'{mod.__name__}.{func.__name__}.{host.name}' + yield (funcFullName, func) + + +funcs = list(gatherFuncs()) + +for name, func in funcs: + func()