Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e1d5de3
Update get_cluster_hosts() utility to read host config details
wmudge May 9, 2025
7a0927c
Add parse_host_result() and create_host_model() utility functions
wmudge May 9, 2025
45574aa
Refactor host module and tests using pytest fixtures
wmudge May 9, 2025
1ad0ae2
Add HostTemplateException
wmudge May 9, 2025
9b21cea
Add view parameter to get_host() utility function
wmudge May 9, 2025
9ce98fd
Update create_role() to handle host assignment lookup
wmudge May 9, 2025
9b0f0a6
Update error message on missing 'type' parameter
wmudge May 9, 2025
583977e
Refactor host module for updated logic and shared functions
wmudge May 9, 2025
603f9bd
Add shared pytest utilities for 'host' module testing
wmudge May 9, 2025
0d07a60
Add tests for host cluster attach/detach functions
wmudge May 9, 2025
25caa73
Add tests for host template assignments and bi-directional reconcilia…
wmudge May 9, 2025
07e1c3b
Add tests for role config group assignments and reconciliation for h…
wmudge May 9, 2025
2b272a1
Add tests for role configuration overrides and reconciliation for hosts
wmudge May 9, 2025
2a37f9a
Update tests for core host management and configuration
wmudge May 9, 2025
a189276
Remove obsolete code
wmudge May 9, 2025
d467825
Update host module documentation
wmudge May 9, 2025
4d01e54
Update host_info module to use utility functions and latest logic
wmudge May 9, 2025
0ca249b
Rename class for host module
wmudge May 9, 2025
c311971
Remove unused import
wmudge May 9, 2025
23e3917
Update tests for host_info to use pytest fixtures
wmudge May 9, 2025
ff1bacb
Remove unused imports
wmudge May 9, 2025
1d9d67d
Updated resettable_host() fixture factory to handle cluster attachment
wmudge May 9, 2025
07430df
Create tests for host cluster attachment
wmudge May 9, 2025
e7df8e0
Update error message
wmudge May 9, 2025
19a5b05
Remove obsolete test
wmudge May 9, 2025
ae94cea
Add retry to wait_command() utility
wmudge May 9, 2025
8566ef8
Add retry and parcel staging monitoring to host template reconciliation
wmudge May 9, 2025
4b41bf6
Add guard to role type lookups during role model creation
wmudge May 9, 2025
16deaaa
Add AutoTLS toggle and First Run toggle (i.e. force init)
wmudge May 9, 2025
93dac70
Add parcel deployment monitoring for cluster membership
wmudge May 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion plugins/module_utils/cluster_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ApiCluster,
ApiHost,
ClustersResourceApi,
HostsResourceApi,
)


Expand Down Expand Up @@ -53,10 +54,19 @@ def parse_cluster_result(cluster: ApiCluster) -> dict:

# TODO Convert to use cluster_name vs the ApiCluster object for broader usage in pytest fixtures
def get_cluster_hosts(api_client: ApiClient, cluster: ApiCluster) -> list[ApiHost]:
return (
hosts = (
ClustersResourceApi(api_client)
.list_hosts(
cluster_name=cluster.name,
)
.items
)

host_api = HostsResourceApi(api_client)

for h in hosts:
h.config = host_api.read_host_config(
host_id=h.host_id,
)

return hosts
11 changes: 9 additions & 2 deletions plugins/module_utils/cm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,21 @@ def wait_commands(


def wait_command(
api_client: ApiClient, command: ApiCommand, polling: int = 120, delay: int = 10
api_client: ApiClient,
command: ApiCommand,
polling: int = 120,
delay: int = 10,
retry: int = 0,
):
poll_count = 0
while command.active:
retry_count = 0

while command.active or retry_count < retry:
if poll_count > polling:
raise Exception("Command timeout: " + str(command.id))
sleep(delay)
poll_count += 1
retry_count += 1
command = CommandsResourceApi(api_client).read_command(command.id)
if not command.success:
raise Exception(command.result_message)
Expand Down
4 changes: 4 additions & 0 deletions plugins/module_utils/host_template_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
)


class HostTemplateException(Exception):
pass


def parse_host_template(host_template: ApiHostTemplate) -> dict:
return dict(
name=host_template.name,
Expand Down
Loading
Loading