Update receptor conf when address changes

Add post save and post delete hooks to
call write_receptor_config when
a receptor address is added / removed.

Add peers_from_control_nodes to
provision_instance

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
This commit is contained in:
Seth Foster
2023-10-05 15:15:58 -04:00
committed by Seth Foster
parent 5199cc5246
commit 5cb3d3b078
5 changed files with 37 additions and 11 deletions

View File

@@ -703,9 +703,10 @@ def generate_config_data():
receptor_config = list(RECEPTOR_CONFIG_STARTER)
for instance in instances:
if instance.listener_port:
peer = {'tcp-peer': {'address': f'{instance.hostname}:{instance.listener_port}', 'tls': 'tlsclient'}}
receptor_config.append(peer)
# receptor_addresses = instance.receptor_addresses.all()
# if not receptor_addresses.exists() and instance.listener_port:
# 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 = {