jumpserver/apps/assets/automations/gather_facts/manager.py

24 lines
591 B
Python
Raw Normal View History

2022-10-12 10:08:57 +00:00
from ..base.manager import BasePlaybookManager
class GatherFactsManager(BasePlaybookManager):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
2022-10-14 10:59:28 +00:00
self.host_asset_mapper = {}
2022-10-12 10:08:57 +00:00
2022-10-14 10:59:28 +00:00
@classmethod
def method_type(cls):
return 'gather_facts'
2022-10-12 10:08:57 +00:00
2022-10-14 10:59:28 +00:00
def host_callback(self, host, asset=None, **kwargs):
super().host_callback(host, asset=asset, **kwargs)
self.host_asset_mapper[host['name']] = asset
2022-10-12 10:08:57 +00:00
2022-10-14 10:59:28 +00:00
def on_host_success(self, host, result):
print("Host: {}".format(host))
print("Result: {}".format(result))
2022-10-12 10:08:57 +00:00