Remove receptor_address module from collection

After removing CRUD from receptor addresses, we need
to remove the module.

- remove receptor_address module
- Add listener_port to instance module
- Add peers_from_control_nodes to instance module

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
This commit is contained in:
Seth Foster
2024-01-16 14:37:21 -05:00
committed by Seth Foster
parent a188798543
commit 69102cf265
7 changed files with 22 additions and 181 deletions

View File

@@ -58,6 +58,11 @@ options:
- installed
required: False
type: str
listener_port:
description:
- Port that Receptor will listen for incoming connections on.
required: False
type: int
peers:
description:
- List of peers to connect outbound to. Only configurable for hop and execution nodes.
@@ -67,6 +72,11 @@ options:
required: False
type: list
elements: str
peers_from_control_nodes:
description:
- If enabled, control plane nodes will automatically peer to this node.
required: False
type: bool
extends_documentation_fragment: awx.awx.auth
'''
@@ -107,7 +117,9 @@ def main():
managed_by_policy=dict(type='bool'),
node_type=dict(type='str', choices=['execution', 'hop']),
node_state=dict(type='str', choices=['deprovisioning', 'installed']),
listener_port=dict(type='int'),
peers=dict(required=False, type='list', elements='str'),
peers_from_control_nodes=dict(required=False, type='bool'),
)
# Create a module for ourselves
@@ -120,7 +132,9 @@ def main():
managed_by_policy = module.params.get('managed_by_policy')
node_type = module.params.get('node_type')
node_state = module.params.get('node_state')
listener_port = module.params.get('listener_port')
peers = module.params.get('peers')
peers_from_control_nodes = module.params.get('peers_from_control_nodes')
# Attempt to look up an existing item based on the provided data
existing_item = module.get_one('instances', name_or_id=hostname)
@@ -147,8 +161,12 @@ def main():
new_fields['node_type'] = node_type
if node_state is not None:
new_fields['node_state'] = node_state
if listener_port is not None:
new_fields['listener_port'] = listener_port
if peers is not None:
new_fields['peers'] = peers_ids
if peers_from_control_nodes is not None:
new_fields['peers_from_control_nodes'] = peers_from_control_nodes
module.create_or_update_if_needed(
existing_item,