mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 11:11:07 -03:30
Connect from controlplane node to mesh ingress
This commit is contained in:
@@ -27,3 +27,11 @@ class ReceptorAddress(models.Model):
|
|||||||
port = f":{self.port}"
|
port = f":{self.port}"
|
||||||
|
|
||||||
return f"{scheme}{self.address}{port}{path}"
|
return f"{scheme}{self.address}{port}{path}"
|
||||||
|
|
||||||
|
def get_peer_type(self):
|
||||||
|
if self.protocol == 'tcp':
|
||||||
|
return 'tcp-peer'
|
||||||
|
elif self.protocol in ['ws', 'wss']:
|
||||||
|
return 'ws-peer'
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|||||||
@@ -703,8 +703,20 @@ def generate_config_data():
|
|||||||
|
|
||||||
receptor_config = list(RECEPTOR_CONFIG_STARTER)
|
receptor_config = list(RECEPTOR_CONFIG_STARTER)
|
||||||
for instance in instances:
|
for instance in instances:
|
||||||
peer = {'tcp-peer': {'address': f'{instance.hostname}:{instance.listener_port}', 'tls': 'tlsclient'}}
|
if instance.listener_port:
|
||||||
receptor_config.append(peer)
|
peer = {'tcp-peer': {'address': f'{instance.hostname}:{instance.listener_port}', 'tls': 'tlsclient'}}
|
||||||
|
receptor_config.append(peer)
|
||||||
|
for address in instance.receptor_addresses.all():
|
||||||
|
if address.get_peer_type() and address.is_internal:
|
||||||
|
peer = {
|
||||||
|
f'{address.get_peer_type()}': {
|
||||||
|
'address': f'{address.get_full_address()}',
|
||||||
|
'tls': 'tlsclient',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
receptor_config.append(peer)
|
||||||
|
else:
|
||||||
|
logger.warning(f"Receptor address {address} has unsupported peer type, skipping.")
|
||||||
should_update = should_update_config(instances)
|
should_update = should_update_config(instances)
|
||||||
return receptor_config, should_update
|
return receptor_config, should_update
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user