mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
Disable autodiscovery except for docker-compose (#11142)
This commit is contained in:
@@ -480,10 +480,12 @@ def inspect_execution_nodes(instance_list):
|
|||||||
changed = False
|
changed = False
|
||||||
if hostname in node_lookup:
|
if hostname in node_lookup:
|
||||||
instance = node_lookup[hostname]
|
instance = node_lookup[hostname]
|
||||||
else:
|
elif settings.MESH_AUTODISCOVERY_ENABLED:
|
||||||
defaults = dict(enabled=False)
|
defaults = dict(enabled=False)
|
||||||
(changed, instance) = Instance.objects.register(hostname=hostname, node_type='execution', defaults=defaults)
|
(changed, instance) = Instance.objects.register(hostname=hostname, node_type='execution', defaults=defaults)
|
||||||
logger.warn(f"Registered execution node '{hostname}' (marked disabled by default)")
|
logger.warn(f"Registered execution node '{hostname}' (marked disabled by default)")
|
||||||
|
else:
|
||||||
|
logger.warn(f"Unrecognized node on mesh advertising ansible-runner work type: {hostname}")
|
||||||
|
|
||||||
was_lost = instance.is_lost(ref_time=nowtime)
|
was_lost = instance.is_lost(ref_time=nowtime)
|
||||||
last_seen = parse_date(ad['Time'])
|
last_seen = parse_date(ad['Time'])
|
||||||
@@ -494,17 +496,6 @@ def inspect_execution_nodes(instance_list):
|
|||||||
instance.save(update_fields=['last_seen'])
|
instance.save(update_fields=['last_seen'])
|
||||||
|
|
||||||
if changed:
|
if changed:
|
||||||
try:
|
|
||||||
default_ig = InstanceGroup.objects.get(name=settings.DEFAULT_EXECUTION_QUEUE_NAME)
|
|
||||||
if instance.hostname not in default_ig.policy_instance_list:
|
|
||||||
default_ig.policy_instance_list += [instance.hostname]
|
|
||||||
default_ig.save(update_fields=['policy_instance_list'])
|
|
||||||
logger.warn(f"Updated '{default_ig.name}' instance group's policy_instance_list to include execution node '{hostname}'")
|
|
||||||
else:
|
|
||||||
logger.warn(f"'{default_ig.name}' instance group's policy_instance_list already listed execution node '{hostname}'")
|
|
||||||
except InstanceGroup.DoesNotExist:
|
|
||||||
logger.error(f"Unable to add execution node '{hostname}' to '{default_ig.name}' instance group; group not found.")
|
|
||||||
|
|
||||||
execution_node_health_check.apply_async([hostname])
|
execution_node_health_check.apply_async([hostname])
|
||||||
elif was_lost:
|
elif was_lost:
|
||||||
# if the instance *was* lost, but has appeared again,
|
# if the instance *was* lost, but has appeared again,
|
||||||
|
|||||||
@@ -263,6 +263,10 @@ 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',
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ AWX_ROLES_ENABLED = True
|
|||||||
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