From 07efe9b271e11f48f57df0830ee11310ff24fe78 Mon Sep 17 00:00:00 2001 From: Nathan Denny Date: Tue, 8 Apr 2025 11:55:28 -0400 Subject: [PATCH] adding "enroll assets" as a command line action --- bin/bastion.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/bastion.py b/bin/bastion.py index b57c640..55425de 100755 --- a/bin/bastion.py +++ b/bin/bastion.py @@ -194,7 +194,8 @@ def run(self): ("export vaults declared", "list vaults declared", self.do_export_vaults_declared), - ("refresh keytab", self.do_refresh_keytab) + ("refresh keytab", self.do_refresh_keytab), + ("enroll assets", self.do_enroll_assets) ] #-- Look for an explicitly declared session ID in opts; @@ -801,6 +802,14 @@ def do_refresh_keytab(self, request): else: return request.failed(result, report = "keytab regeneration failed") + def do_enroll_assets(self, request): + """ + Given a site and zone, I scan the folders in the zone and create a new configuration file based on the contents of the zone. + On successful completion, I create (or overwrite) a configuration file that is the asset catalog for the given zone. + By default, the asset catalog is written to ~/.bastion/conf-{site}-{zone}-catalog.yaml, unless otherwise specified by the arg: + "catalog.path" + """ + raise NotImplementedError if __name__ == '__main__':