jumpserver/apps/assets/const/host.py

45 lines
1.1 KiB
Python
Raw Normal View History

2022-09-19 12:11:55 +00:00
from .base import BaseType
2022-09-18 16:07:59 +00:00
2022-09-19 12:11:55 +00:00
class HostTypes(BaseType):
2022-09-18 16:07:59 +00:00
LINUX = 'linux', 'Linux'
WINDOWS = 'windows', 'Windows'
UNIX = 'unix', 'Unix'
2022-09-19 12:11:55 +00:00
OTHER_HOST = 'other', "Other"
2022-09-18 16:07:59 +00:00
@classmethod
2022-09-19 12:11:55 +00:00
def _get_base_constrains(cls) -> dict:
2022-09-18 16:07:59 +00:00
return {
2022-09-19 12:11:55 +00:00
'*': {
'domain_enabled': True,
'su_enabled': True,
2022-09-18 16:07:59 +00:00
},
cls.WINDOWS: {
2022-09-19 12:11:55 +00:00
'su_enabled': False,
2022-09-18 16:07:59 +00:00
},
2022-09-19 12:11:55 +00:00
cls.OTHER_HOST: {
'su_enabled': False,
2022-09-18 16:07:59 +00:00
}
2022-09-19 12:11:55 +00:00
}
@classmethod
def _get_protocol_constrains(cls) -> dict:
return {
'*': {
'choices': ['ssh', 'telnet', 'vnc', 'rdp']
}
}
@classmethod
def _get_automation_constrains(cls) -> dict:
return {
'*': {
'ping_enabled': True,
'gather_facts_enabled': True,
'gather_accounts_enabled': True,
'verify_account_enabled': True,
'change_password_enabled': True,
'create_account_enabled': True,
}
}