mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 20:37:39 -02:30
Remove the auto-discovery feature
This commit is contained in:
@@ -67,7 +67,6 @@ from awx.main.models import (
|
|||||||
TowerScheduleState,
|
TowerScheduleState,
|
||||||
Instance,
|
Instance,
|
||||||
InstanceGroup,
|
InstanceGroup,
|
||||||
InstanceLink,
|
|
||||||
UnifiedJob,
|
UnifiedJob,
|
||||||
Notification,
|
Notification,
|
||||||
Inventory,
|
Inventory,
|
||||||
@@ -505,21 +504,12 @@ def inspect_execution_nodes(instance_list):
|
|||||||
workers = mesh_status['Advertisements']
|
workers = mesh_status['Advertisements']
|
||||||
for ad in workers:
|
for ad in workers:
|
||||||
hostname = ad['NodeID']
|
hostname = ad['NodeID']
|
||||||
if ad.get('WorkCommands') is None:
|
if not any(cmd['WorkType'] == 'ansible-runner' for cmd in ad['WorkCommands'] or []):
|
||||||
node_type = 'hop'
|
|
||||||
elif any(cmd['WorkType'] == 'ansible-runner' for cmd in ad['WorkCommands'] or []):
|
|
||||||
node_type = 'execution'
|
|
||||||
else:
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
changed = False
|
changed = False
|
||||||
if hostname in node_lookup:
|
if hostname in node_lookup:
|
||||||
instance = node_lookup[hostname]
|
instance = node_lookup[hostname]
|
||||||
elif settings.MESH_AUTODISCOVERY_ENABLED:
|
|
||||||
defaults = dict(enabled=False)
|
|
||||||
(changed, instance) = Instance.objects.register(hostname=hostname, node_type=node_type, defaults=defaults)
|
|
||||||
node_lookup[hostname] = instance
|
|
||||||
logger.warn(f"Registered execution node '{hostname}' (marked disabled by default)")
|
|
||||||
else:
|
else:
|
||||||
logger.warn(f"Unrecognized node on mesh advertising ansible-runner work type: {hostname}")
|
logger.warn(f"Unrecognized node on mesh advertising ansible-runner work type: {hostname}")
|
||||||
continue
|
continue
|
||||||
@@ -548,17 +538,6 @@ def inspect_execution_nodes(instance_list):
|
|||||||
logger.debug(f'Restarting health check for execution node {hostname} with known errors.')
|
logger.debug(f'Restarting health check for execution node {hostname} with known errors.')
|
||||||
execution_node_health_check.apply_async([hostname])
|
execution_node_health_check.apply_async([hostname])
|
||||||
|
|
||||||
links = {tuple(sorted((node, peer))) for node, peers in mesh_status['KnownConnectionCosts'].items() for peer in peers}
|
|
||||||
for a, b in links:
|
|
||||||
if a not in node_lookup:
|
|
||||||
logger.warn(f"Cannot link {a} to {b}: {a} not registered.")
|
|
||||||
continue
|
|
||||||
if b not in node_lookup:
|
|
||||||
logger.warn(f"Cannot link {a} to {b}: {b} not registered.")
|
|
||||||
continue
|
|
||||||
a_obj, b_obj = node_lookup[a], node_lookup[b]
|
|
||||||
InstanceLink.objects.get_or_create(source=a_obj, target=b_obj)
|
|
||||||
|
|
||||||
|
|
||||||
@task(queue=get_local_queuename)
|
@task(queue=get_local_queuename)
|
||||||
def cluster_node_heartbeat():
|
def cluster_node_heartbeat():
|
||||||
|
|||||||
@@ -262,10 +262,6 @@ CSRF_COOKIE_SECURE = True
|
|||||||
# Limit CSRF cookies to browser sessions
|
# Limit CSRF cookies to browser sessions
|
||||||
CSRF_COOKIE_AGE = None
|
CSRF_COOKIE_AGE = None
|
||||||
|
|
||||||
# Auto-discover new instances that appear on receptor mesh
|
|
||||||
# used for docker-compose environment, unsupported
|
|
||||||
MESH_AUTODISCOVERY_ENABLED = False
|
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'NAME': 'default',
|
'NAME': 'default',
|
||||||
|
|||||||
@@ -55,9 +55,6 @@ template['OPTIONS']['loaders'] = ('django.template.loaders.filesystem.Loader', '
|
|||||||
PENDO_TRACKING_STATE = "off"
|
PENDO_TRACKING_STATE = "off"
|
||||||
INSIGHTS_TRACKING_STATE = False
|
INSIGHTS_TRACKING_STATE = False
|
||||||
|
|
||||||
# auto-discover receptor-* execution nodes
|
|
||||||
MESH_AUTODISCOVERY_ENABLED = True
|
|
||||||
|
|
||||||
# debug toolbar and swagger assume that requirements/requirements_dev.txt are installed
|
# debug toolbar and swagger assume that requirements/requirements_dev.txt are installed
|
||||||
|
|
||||||
INSTALLED_APPS += ['rest_framework_swagger', 'debug_toolbar'] # NOQA
|
INSTALLED_APPS += ['rest_framework_swagger', 'debug_toolbar'] # NOQA
|
||||||
|
|||||||
Reference in New Issue
Block a user