instead of having a pre established pre, play and post now its just a list of tasks

This commit is contained in:
2026-07-26 23:27:25 +01:00
parent 1acb32a074
commit f3d430d772
5 changed files with 95 additions and 112 deletions
+10 -13
View File
@@ -1,11 +1,8 @@
import os
import sys
import json
import argparse
import traceback
import importlib.util
from typing import List
from playbook import StepLog, CustomStep, Play, Status
from playbook import Play
from dataclasses import asdict
from playbook.action_registry import ActionRegistry
@@ -22,24 +19,24 @@ def parse_args() -> argparse.Namespace:
help="Path to the playbook yaml file"
)
# Flag for the custom registry files
parser.add_argument(
"-r", "--registry",
nargs="+",
default=[],
help="One or more python files with actions"
)
# NOTE: For now I will only take the registries from the yaml playbook
# # Flag for the custom registry files
# parser.add_argument(
# "-r", "--registry",
# nargs="+",
# default=[],
# help="One or more python files with actions"
# )
return parser.parse_args()
def main():
args: argparse.Namespace = parse_args()
extra_regs: List[ActionRegistry] = []
newPlay: Play
try:
newPlay = Play.from_yaml(args.playbook, registries=extra_regs)
newPlay = Play.from_yaml(args.playbook)
except Exception as e:
print(f"Failed to load playbook: {e}")
traceback.print_exc()