mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
add an AWX_ISOLATED_VERBOSITY setting for debugging isolated connections
This commit is contained in:
@@ -197,6 +197,18 @@ register(
|
|||||||
category_slug='jobs',
|
category_slug='jobs',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
register(
|
||||||
|
'AWX_ISOLATED_VERBOSITY',
|
||||||
|
field_class=fields.IntegerField,
|
||||||
|
min_value=0,
|
||||||
|
max_value=5,
|
||||||
|
label=_('Verbosity level for isolated node management tasks'),
|
||||||
|
help_text=_('This can be raised to aid in debugging connection issues for isolated task execution'),
|
||||||
|
category=_('Jobs'),
|
||||||
|
category_slug='jobs',
|
||||||
|
default=0
|
||||||
|
)
|
||||||
|
|
||||||
register(
|
register(
|
||||||
'AWX_ISOLATED_CHECK_INTERVAL',
|
'AWX_ISOLATED_CHECK_INTERVAL',
|
||||||
field_class=fields.IntegerField,
|
field_class=fields.IntegerField,
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ class IsolatedManager(object):
|
|||||||
]
|
]
|
||||||
if extra_vars:
|
if extra_vars:
|
||||||
args.extend(['-e', json.dumps(extra_vars)])
|
args.extend(['-e', json.dumps(extra_vars)])
|
||||||
|
if settings.AWX_ISOLATED_VERBOSITY:
|
||||||
|
args.append('-%s' % ('v' * min(5, settings.AWX_ISOLATED_VERBOSITY)))
|
||||||
return args
|
return args
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -420,16 +422,18 @@ class IsolatedManager(object):
|
|||||||
idle_timeout=timeout, job_timeout=timeout,
|
idle_timeout=timeout, job_timeout=timeout,
|
||||||
pexpect_timeout=5
|
pexpect_timeout=5
|
||||||
)
|
)
|
||||||
|
heartbeat_stdout = buff.getvalue().encode('utf-8')
|
||||||
|
buff.close()
|
||||||
|
|
||||||
for instance in instance_qs:
|
for instance in instance_qs:
|
||||||
output = buff.getvalue()
|
output = heartbeat_stdout
|
||||||
|
task_result = {}
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(facts_path, instance.hostname), 'r') as facts_data:
|
with open(os.path.join(facts_path, instance.hostname), 'r') as facts_data:
|
||||||
output = facts_data.read()
|
output = facts_data.read()
|
||||||
task_result = json.loads(output)
|
task_result = json.loads(output)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception('Failed to read status from isolated instances, output:\n {}'.format(output))
|
logger.exception('Failed to read status from isolated instances, output:\n {}'.format(output))
|
||||||
return
|
|
||||||
if 'awx_capacity_cpu' in task_result and 'awx_capacity_mem' in task_result:
|
if 'awx_capacity_cpu' in task_result and 'awx_capacity_mem' in task_result:
|
||||||
task_result = {
|
task_result = {
|
||||||
'capacity_cpu': task_result['awx_capacity_cpu'],
|
'capacity_cpu': task_result['awx_capacity_cpu'],
|
||||||
|
|||||||
@@ -430,6 +430,9 @@ AWX_ISOLATED_CONNECTION_TIMEOUT = 10
|
|||||||
# The time (in seconds) between the periodic isolated heartbeat status check
|
# The time (in seconds) between the periodic isolated heartbeat status check
|
||||||
AWX_ISOLATED_PERIODIC_CHECK = 600
|
AWX_ISOLATED_PERIODIC_CHECK = 600
|
||||||
|
|
||||||
|
# Verbosity level for isolated node management tasks
|
||||||
|
AWX_ISOLATED_VERBOSITY = 0
|
||||||
|
|
||||||
# Memcached django cache configuration
|
# Memcached django cache configuration
|
||||||
# CACHES = {
|
# CACHES = {
|
||||||
# 'default': {
|
# 'default': {
|
||||||
|
|||||||
Reference in New Issue
Block a user