mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-29 21:51:31 +00:00
pref: 修改 applet host deploy
This commit is contained in:
@@ -9,8 +9,9 @@ __all__ = ['JMSInventory']
|
||||
|
||||
|
||||
class JMSInventory:
|
||||
def __init__(self, manager, assets=None, account_policy='smart',
|
||||
account_prefer='root,administrator', host_callback=None):
|
||||
def __init__(self, assets, account_policy='smart',
|
||||
account_prefer='root,administrator',
|
||||
host_callback=None):
|
||||
"""
|
||||
:param assets:
|
||||
:param account_prefer: account username name if not set use account_policy
|
||||
@@ -79,10 +80,7 @@ class JMSInventory:
|
||||
ssh_protocol_matched = list(filter(lambda x: x.name == 'ssh', protocols))
|
||||
ssh_protocol = ssh_protocol_matched[0] if ssh_protocol_matched else None
|
||||
host['ansible_host'] = asset.address
|
||||
if asset.port == 0:
|
||||
host['ansible_port'] = ssh_protocol.port if ssh_protocol else 22
|
||||
else:
|
||||
host['ansible_port'] = asset.port
|
||||
host['ansible_port'] = ssh_protocol.port if ssh_protocol else 22
|
||||
|
||||
su_from = account.su_from
|
||||
if platform.su_enabled and su_from:
|
||||
|
||||
@@ -99,7 +99,7 @@ class CeleryPeriodTaskViewSet(CommonApiMixin, viewsets.ModelViewSet):
|
||||
|
||||
|
||||
class CeleryTaskViewSet(CommonApiMixin, viewsets.ReadOnlyModelViewSet):
|
||||
queryset = CeleryTask.objects.filter(name__in=['ops.tasks.hello', 'ops.tasks.hello_error', 'ops.tasks.hello_random'])
|
||||
queryset = CeleryTask.objects.all()
|
||||
serializer_class = CeleryTaskSerializer
|
||||
http_method_names = ('get', 'head', 'options',)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user