2017-12-12 04:19:45 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2019-09-17 10:59:54 +00:00
|
|
|
import os
|
2019-10-09 02:43:51 +00:00
|
|
|
|
|
|
|
from django.conf import settings
|
2019-06-21 12:57:51 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2019-05-20 11:39:53 +00:00
|
|
|
|
2019-09-17 10:59:54 +00:00
|
|
|
|
2019-10-09 02:43:51 +00:00
|
|
|
ENV_PERIOD_TASK = os.environ.get("PERIOD_TASK", "on") == 'on'
|
|
|
|
PERIOD_TASK_ENABLED = settings.PERIOD_TASK_ENABLED and ENV_PERIOD_TASK
|
2019-09-17 10:59:54 +00:00
|
|
|
|
2017-12-15 07:50:15 +00:00
|
|
|
UPDATE_ASSETS_HARDWARE_TASKS = [
|
|
|
|
{
|
2017-12-29 15:53:45 +00:00
|
|
|
'name': "setup",
|
2017-12-15 07:50:15 +00:00
|
|
|
'action': {
|
|
|
|
'module': 'setup'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
TEST_ADMIN_USER_CONN_TASKS = [
|
|
|
|
{
|
2017-12-29 15:53:45 +00:00
|
|
|
"name": "ping",
|
2017-12-15 07:50:15 +00:00
|
|
|
"action": {
|
|
|
|
"module": "ping",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-06-13 10:58:43 +00:00
|
|
|
TEST_WINDOWS_ADMIN_USER_CONN_TASKS = [
|
|
|
|
{
|
|
|
|
"name": "ping",
|
|
|
|
"action": {
|
|
|
|
"module": "win_ping",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2017-12-15 07:50:15 +00:00
|
|
|
|
|
|
|
ASSET_ADMIN_CONN_CACHE_KEY = "ASSET_ADMIN_USER_CONN_{}"
|
|
|
|
|
|
|
|
SYSTEM_USER_CONN_CACHE_KEY = "SYSTEM_USER_CONN_{}"
|
|
|
|
TEST_SYSTEM_USER_CONN_TASKS = [
|
|
|
|
{
|
2017-12-29 15:53:45 +00:00
|
|
|
"name": "ping",
|
2017-12-15 07:50:15 +00:00
|
|
|
"action": {
|
|
|
|
"module": "ping",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-06-13 10:58:43 +00:00
|
|
|
TEST_WINDOWS_SYSTEM_USER_CONN_TASKS = [
|
|
|
|
{
|
|
|
|
"name": "ping",
|
|
|
|
"action": {
|
|
|
|
"module": "win_ping",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-03-18 02:15:33 +00:00
|
|
|
|
|
|
|
TEST_ASSET_USER_CONN_TASKS = [
|
|
|
|
{
|
|
|
|
"name": "ping",
|
|
|
|
"action": {
|
|
|
|
"module": "ping",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-06-13 10:58:43 +00:00
|
|
|
TEST_WINDOWS_ASSET_USER_CONN_TASKS = [
|
|
|
|
{
|
|
|
|
"name": "ping",
|
|
|
|
"action": {
|
|
|
|
"module": "win_ping",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-03-18 02:15:33 +00:00
|
|
|
|
|
|
|
|
2017-12-15 07:50:15 +00:00
|
|
|
TASK_OPTIONS = {
|
2017-12-15 09:07:52 +00:00
|
|
|
'timeout': 10,
|
2017-12-15 07:50:15 +00:00
|
|
|
'forks': 10,
|
|
|
|
}
|
2019-04-15 06:33:16 +00:00
|
|
|
|
|
|
|
CACHE_KEY_ASSET_BULK_UPDATE_ID_PREFIX = '_KEY_ASSET_BULK_UPDATE_ID_{}'
|
2019-06-21 12:57:51 +00:00
|
|
|
CONN_UNREACHABLE, CONN_REACHABLE, CONN_UNKNOWN = range(0, 3)
|
|
|
|
CONNECTIVITY_CHOICES = (
|
|
|
|
(CONN_UNREACHABLE, _("Unreachable")),
|
|
|
|
(CONN_REACHABLE, _('Reachable')),
|
|
|
|
(CONN_UNKNOWN, _("Unknown")),
|
|
|
|
)
|
2019-05-20 11:39:53 +00:00
|
|
|
|
2019-09-17 10:59:54 +00:00
|
|
|
GATHER_ASSET_USERS_TASKS = [
|
|
|
|
{
|
|
|
|
"name": "gather host users",
|
|
|
|
"action": {
|
|
|
|
"module": 'getent',
|
|
|
|
"args": "database=passwd"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
GATHER_ASSET_USERS_TASKS_WINDOWS = [
|
|
|
|
{
|
|
|
|
"name": "gather windows host users",
|
|
|
|
"action": {
|
|
|
|
"module": 'win_shell',
|
|
|
|
"args": "net user"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|