From ab6fade9c8fe49176c7589ed862d7d4073ca93e8 Mon Sep 17 00:00:00 2001 From: Webster Mudge Date: Tue, 17 Jun 2025 13:42:26 -0400 Subject: [PATCH] Update Python shebang and documentation organization Signed-off-by: Webster Mudge --- galaxy.yml | 11 +- plugins/action/assemble_cluster_template.py | 3 + plugins/action/cm_api.py | 2 +- plugins/doc_fragments/cm_endpoint.py | 1 - plugins/doc_fragments/cm_options.py | 1 - plugins/doc_fragments/cm_resource.py | 1 - plugins/doc_fragments/message.py | 1 - plugins/doc_fragments/purge.py | 1 - plugins/filter/filters.py | 2 +- plugins/lookup/cm_license.py | 1 + plugins/lookup/cm_service.py | 2 + plugins/module_utils/cluster_utils.py | 2 + plugins/module_utils/cm_controller_utils.py | 1 - plugins/module_utils/cm_utils.py | 2 + plugins/module_utils/data_context_utils.py | 2 + plugins/module_utils/host_template_utils.py | 2 + plugins/module_utils/host_utils.py | 2 + plugins/module_utils/parcel_utils.py | 2 + .../module_utils/role_config_group_utils.py | 2 + plugins/module_utils/role_utils.py | 2 + plugins/module_utils/service_utils.py | 2 + plugins/modules/assemble_cluster_template.py | 11 +- plugins/modules/cluster.py | 107 +++---- plugins/modules/cluster_info.py | 35 +- plugins/modules/cm_autotls.py | 2 +- plugins/modules/cm_autotls_info.py | 12 +- plugins/modules/cm_config.py | 26 +- plugins/modules/cm_config_info.py | 20 +- plugins/modules/cm_endpoint_info.py | 17 +- plugins/modules/cm_kerberos.py | 2 +- plugins/modules/cm_kerberos_info.py | 13 +- plugins/modules/cm_license.py | 24 +- plugins/modules/cm_license_info.py | 24 +- plugins/modules/cm_resource.py | 20 +- plugins/modules/cm_resource_info.py | 19 +- plugins/modules/cm_service_info.py | 1 - .../cm_service_role_config_group_info.py | 1 - plugins/modules/cm_service_role_info.py | 1 - plugins/modules/cm_trial_license.py | 24 +- plugins/modules/cm_version_info.py | 24 +- plugins/modules/data_context.py | 40 +-- plugins/modules/data_context_info.py | 32 +- plugins/modules/external_account.py | 31 +- plugins/modules/external_account_info.py | 21 +- plugins/modules/external_user_mappings.py | 32 +- .../modules/external_user_mappings_info.py | 30 +- plugins/modules/host_config.py | 37 +-- plugins/modules/host_config_info.py | 24 +- plugins/modules/parcel.py | 33 +- plugins/modules/parcel_info.py | 31 +- plugins/modules/service_config.py | 1 - plugins/modules/service_config_info.py | 30 +- plugins/modules/service_role_config.py | 42 +-- .../service_role_config_group_config.py | 42 +-- .../service_role_config_group_config_info.py | 33 +- .../modules/service_role_config_group_info.py | 7 - plugins/modules/service_role_config_info.py | 32 +- plugins/modules/service_role_info.py | 2 +- plugins/modules/service_type_info.py | 23 +- plugins/modules/user.py | 37 +-- plugins/modules/user_info.py | 24 +- requirements.txt | 1 - tests/return-values-cm_service.yml | 303 ------------------ tests/return-values-cm_service_role.yml | 157 --------- ...rn-values-cm_service_role_config_group.yml | 48 --- 65 files changed, 423 insertions(+), 1098 deletions(-) delete mode 100644 tests/return-values-cm_service.yml delete mode 100644 tests/return-values-cm_service_role.yml delete mode 100644 tests/return-values-cm_service_role_config_group.yml diff --git a/galaxy.yml b/galaxy.yml index 29e7c99d..72af1b5b 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,5 +1,3 @@ ---- - # Copyright 2023 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +--- + namespace: cloudera name: cluster version: 4.5.0-rc1 @@ -25,13 +25,14 @@ authors: description: > A set of roles, modules, and other plugins for interacting with the services - and endpoints provided by the Cloudera Data Platform (CDP) for Private Cloud - and Cloudera Manager (CM). + and endpoints provided by Cloudera on Premises and Cloudera Manager (CM). license_file: LICENSE tags: - cloudera - cdp +- cdh - private_cloud +- on_premise - data_services - cloudera_manager - cm @@ -51,3 +52,5 @@ build_ignore: - docs - docsrc - site + +... diff --git a/plugins/action/assemble_cluster_template.py b/plugins/action/assemble_cluster_template.py index fbf57f6b..b8eacb33 100644 --- a/plugins/action/assemble_cluster_template.py +++ b/plugins/action/assemble_cluster_template.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/action/cm_api.py b/plugins/action/cm_api.py index 658ab3a3..efa22600 100644 --- a/plugins/action/cm_api.py +++ b/plugins/action/cm_api.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2023 Cloudera, Inc. All Rights Reserved. diff --git a/plugins/doc_fragments/cm_endpoint.py b/plugins/doc_fragments/cm_endpoint.py index e1d16143..4238eda5 100644 --- a/plugins/doc_fragments/cm_endpoint.py +++ b/plugins/doc_fragments/cm_endpoint.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2023 Cloudera, Inc. All Rights Reserved. diff --git a/plugins/doc_fragments/cm_options.py b/plugins/doc_fragments/cm_options.py index d494ea06..d79e62be 100644 --- a/plugins/doc_fragments/cm_options.py +++ b/plugins/doc_fragments/cm_options.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2023 Cloudera, Inc. All Rights Reserved. diff --git a/plugins/doc_fragments/cm_resource.py b/plugins/doc_fragments/cm_resource.py index 6485618e..0e990f12 100644 --- a/plugins/doc_fragments/cm_resource.py +++ b/plugins/doc_fragments/cm_resource.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2023 Cloudera, Inc. All Rights Reserved. diff --git a/plugins/doc_fragments/message.py b/plugins/doc_fragments/message.py index 75ad35f0..d933e8cf 100644 --- a/plugins/doc_fragments/message.py +++ b/plugins/doc_fragments/message.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2024 Cloudera, Inc. All Rights Reserved. diff --git a/plugins/doc_fragments/purge.py b/plugins/doc_fragments/purge.py index 05027563..800e7635 100644 --- a/plugins/doc_fragments/purge.py +++ b/plugins/doc_fragments/purge.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2024 Cloudera, Inc. All Rights Reserved. diff --git a/plugins/filter/filters.py b/plugins/filter/filters.py index 5eb17638..050fce37 100644 --- a/plugins/filter/filters.py +++ b/plugins/filter/filters.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2023 Cloudera, Inc. All Rights Reserved. diff --git a/plugins/lookup/cm_license.py b/plugins/lookup/cm_license.py index 6994fd44..85e77f1f 100644 --- a/plugins/lookup/cm_license.py +++ b/plugins/lookup/cm_license.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- + # Copyright 2025 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/lookup/cm_service.py b/plugins/lookup/cm_service.py index 657a0ce6..6f1feed5 100644 --- a/plugins/lookup/cm_service.py +++ b/plugins/lookup/cm_service.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/cluster_utils.py b/plugins/module_utils/cluster_utils.py index 0d8ff1a9..13243780 100644 --- a/plugins/module_utils/cluster_utils.py +++ b/plugins/module_utils/cluster_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/cm_controller_utils.py b/plugins/module_utils/cm_controller_utils.py index 2d53f274..ba539770 100644 --- a/plugins/module_utils/cm_controller_utils.py +++ b/plugins/module_utils/cm_controller_utils.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2023 Cloudera, Inc. diff --git a/plugins/module_utils/cm_utils.py b/plugins/module_utils/cm_utils.py index 52e4cf5c..4af537ab 100644 --- a/plugins/module_utils/cm_utils.py +++ b/plugins/module_utils/cm_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/data_context_utils.py b/plugins/module_utils/data_context_utils.py index be4f7c57..b6db9912 100644 --- a/plugins/module_utils/data_context_utils.py +++ b/plugins/module_utils/data_context_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/host_template_utils.py b/plugins/module_utils/host_template_utils.py index f6ac9a27..be3b2635 100644 --- a/plugins/module_utils/host_template_utils.py +++ b/plugins/module_utils/host_template_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/host_utils.py b/plugins/module_utils/host_utils.py index f8534d8b..e538d583 100644 --- a/plugins/module_utils/host_utils.py +++ b/plugins/module_utils/host_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/parcel_utils.py b/plugins/module_utils/parcel_utils.py index 4f962e5c..93b418ef 100644 --- a/plugins/module_utils/parcel_utils.py +++ b/plugins/module_utils/parcel_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/role_config_group_utils.py b/plugins/module_utils/role_config_group_utils.py index 87051409..8d5ff29c 100644 --- a/plugins/module_utils/role_config_group_utils.py +++ b/plugins/module_utils/role_config_group_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2025 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/role_utils.py b/plugins/module_utils/role_utils.py index 1f95b863..8c283f19 100644 --- a/plugins/module_utils/role_utils.py +++ b/plugins/module_utils/role_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/module_utils/service_utils.py b/plugins/module_utils/service_utils.py index 7c08a770..274e17cd 100644 --- a/plugins/module_utils/service_utils.py +++ b/plugins/module_utils/service_utils.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/modules/assemble_cluster_template.py b/plugins/modules/assemble_cluster_template.py index 0acfad66..0c237160 100644 --- a/plugins/modules/assemble_cluster_template.py +++ b/plugins/modules/assemble_cluster_template.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,14 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: assemble_cluster_template short_description: Merge Cloudera Manager cluster template fragments description: @@ -112,7 +108,6 @@ """ EXAMPLES = r""" ---- - name: Assemble a cluster template from files (on the controller) cloudera.cluster.assemble_cluster_template: src: examples diff --git a/plugins/modules/cluster.py b/plugins/modules/cluster.py index 665ab4f5..782edda3 100644 --- a/plugins/modules/cluster.py +++ b/plugins/modules/cluster.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,61 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json, yaml - -from ansible.module_utils.common.text.converters import to_text, to_native - -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - wait_command, - ClouderaManagerModule, - ClusterTemplate, -) - -from ansible_collections.cloudera.cluster.plugins.module_utils.parcel_utils import ( - Parcel, -) - -from ansible_collections.cloudera.cluster.plugins.module_utils.cluster_utils import ( - parse_cluster_result, -) - -from cm_client import ( - ApiCluster, - ApiClusterList, - ApiClusterTemplate, - ApiConfig, - ApiConfigList, - ApiDataContext, - ApiHostRef, - ApiHostRefList, - ApiHostTemplate, - ApiHostTemplateList, - ApiRole, - ApiRoleList, - ApiRoleConfigGroup, - ApiRoleConfigGroupRef, - ApiRoleNameList, - ApiService, - ApiServiceConfig, - ClouderaManagerResourceApi, - ClustersResourceApi, - HostsResourceApi, - HostTemplatesResourceApi, - ParcelResourceApi, - ServicesResourceApi, - RoleConfigGroupsResourceApi, - RolesResourceApi, - ControlPlanesResourceApi, - ApiInstallEmbeddedControlPlaneArgs, -) -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" module: cluster short_description: Manage the lifecycle and state of a cluster @@ -817,6 +765,55 @@ returned: always """ +import json, yaml + +from ansible.module_utils.common.text.converters import to_text, to_native + +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + wait_command, + ClouderaManagerModule, + ClusterTemplate, +) + +from ansible_collections.cloudera.cluster.plugins.module_utils.parcel_utils import ( + Parcel, +) + +from ansible_collections.cloudera.cluster.plugins.module_utils.cluster_utils import ( + parse_cluster_result, +) + +from cm_client import ( + ApiCluster, + ApiClusterList, + ApiClusterTemplate, + ApiConfig, + ApiConfigList, + ApiDataContext, + ApiHostRef, + ApiHostRefList, + ApiHostTemplate, + ApiHostTemplateList, + ApiRole, + ApiRoleList, + ApiRoleConfigGroup, + ApiRoleConfigGroupRef, + ApiRoleNameList, + ApiService, + ApiServiceConfig, + ClouderaManagerResourceApi, + ClustersResourceApi, + HostsResourceApi, + HostTemplatesResourceApi, + ParcelResourceApi, + ServicesResourceApi, + RoleConfigGroupsResourceApi, + RolesResourceApi, + ControlPlanesResourceApi, + ApiInstallEmbeddedControlPlaneArgs, +) +from cm_client.rest import ApiException + class ClouderaCluster(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cluster_info.py b/plugins/modules/cluster_info.py index a397e8b4..17bcb2fc 100644 --- a/plugins/modules/cluster_info.py +++ b/plugins/modules/cluster_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,25 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible.module_utils.basic import to_native - -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from ansible_collections.cloudera.cluster.plugins.module_utils.cluster_utils import ( - parse_cluster_result, -) - -from cm_client.rest import ApiException -from cm_client import ClustersResourceApi - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" module: cluster_info short_description: Retrieve details about one or more clusters @@ -111,6 +95,19 @@ returned: always """ +from ansible.module_utils.basic import to_native + +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from ansible_collections.cloudera.cluster.plugins.module_utils.cluster_utils import ( + parse_cluster_result, +) + +from cm_client.rest import ApiException +from cm_client import ClustersResourceApi + class ClusterInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_autotls.py b/plugins/modules/cm_autotls.py index cc31e773..19ac868e 100644 --- a/plugins/modules/cm_autotls.py +++ b/plugins/modules/cm_autotls.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# + # Copyright 2025 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/modules/cm_autotls_info.py b/plugins/modules/cm_autotls_info.py index 72bed7ed..81bfb841 100644 --- a/plugins/modules/cm_autotls_info.py +++ b/plugins/modules/cm_autotls_info.py @@ -15,11 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException - DOCUMENTATION = r""" module: cm_autotls_info short_description: Retrieve Cloudera Manager configurations for Auto-TLS @@ -45,7 +40,6 @@ """ EXAMPLES = r""" ---- - name: Retrieve Auto-TLS settings cloudera.cluster.cm_autotls_info: host: example.cloudera.com @@ -127,6 +121,12 @@ """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException + + class ClouderaManagerAutoTLSInfo(ClouderaManagerModule): def __init__(self, module): super(ClouderaManagerAutoTLSInfo, self).__init__(module) diff --git a/plugins/modules/cm_config.py b/plugins/modules/cm_config.py index 9c475b3d..39a462e4 100644 --- a/plugins/modules/cm_config.py +++ b/plugins/modules/cm_config.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,21 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cm_client - -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerMutableModule, - resolve_parameter_changeset, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_config short_description: Manage the configuration of Cloudera Manager description: @@ -60,7 +49,6 @@ """ EXAMPLES = r""" ---- - name: Update several Cloudera Manager parameters cloudera.cluster.cm_config: host: example.cloudera.com @@ -80,7 +68,6 @@ """ RETURN = r""" ---- config: description: - List of Cloudera Manager configurations. @@ -159,6 +146,13 @@ returned: when supported """ +import cm_client + +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerMutableModule, + resolve_parameter_changeset, +) + class ClouderaManagerConfig(ClouderaManagerMutableModule): def __init__(self, module): diff --git a/plugins/modules/cm_config_info.py b/plugins/modules/cm_config_info.py index a89113f0..416f7685 100644 --- a/plugins/modules/cm_config_info.py +++ b/plugins/modules/cm_config_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,18 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_config_info short_description: Retrieve the Cloudera Manager configuration description: @@ -48,7 +40,6 @@ """ EXAMPLES = r""" ---- - name: Retrieve the summary (default) settings cloudera.cluster.cm_config_info host: example.cloudera.com @@ -66,7 +57,6 @@ """ RETURN = r""" ---- config: description: - List of Cloudera Manager Server configurations. @@ -146,6 +136,10 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + class ClouderaManagerConfigInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_endpoint_info.py b/plugins/modules/cm_endpoint_info.py index 565e55ee..fbb94ba1 100644 --- a/plugins/modules/cm_endpoint_info.py +++ b/plugins/modules/cm_endpoint_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,16 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" module: cm_endpoint_info short_description: Discover the Cloudera Manager API endpoint @@ -54,6 +47,10 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + class ClouderaEndpointInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_kerberos.py b/plugins/modules/cm_kerberos.py index 9664cb29..eb437c22 100644 --- a/plugins/modules/cm_kerberos.py +++ b/plugins/modules/cm_kerberos.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# + # Copyright 2025 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/modules/cm_kerberos_info.py b/plugins/modules/cm_kerberos_info.py index 8d7c21ce..d4130642 100644 --- a/plugins/modules/cm_kerberos_info.py +++ b/plugins/modules/cm_kerberos_info.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# + # Copyright 2025 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,11 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException - DOCUMENTATION = r""" module: cm_kerberos_info short_description: Retrieve Cloudera Manager configurations for Kerberos @@ -45,7 +40,6 @@ """ EXAMPLES = r""" ---- - name: Retrieve CM Kerberos settings cloudera.cluster.cm_kerberos_info: host: example.cloudera.com @@ -126,6 +120,11 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException + class ClouderaManagerKerberosInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_license.py b/plugins/modules/cm_license.py index 63423d8f..dc7ea3f1 100644 --- a/plugins/modules/cm_license.py +++ b/plugins/modules/cm_license.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,20 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException -from cm_client import ClouderaManagerResourceApi - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_license short_description: Activate the license for Cloudera Manager description: @@ -38,7 +28,6 @@ """ EXAMPLES = r""" ---- - name: Activate Cloudera Manager license cloudera.cluster.cm_license: host: example.cloudera.com @@ -49,7 +38,6 @@ """ RETURN = r""" ---- cloudera_manager: description: Details about a active license type: dict @@ -80,6 +68,12 @@ returned: optional """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException +from cm_client import ClouderaManagerResourceApi + class ClouderaLicense(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_license_info.py b/plugins/modules/cm_license_info.py index a909c85d..20ab3b3c 100644 --- a/plugins/modules/cm_license_info.py +++ b/plugins/modules/cm_license_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,20 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException -from cm_client import ClouderaManagerResourceApi - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_license short_description: Returns details about current license description: @@ -37,7 +27,6 @@ """ EXAMPLES = r""" ---- - name: Get details about a license cloudera.cluster.cm_license_info: host: example.cloudera.com @@ -47,7 +36,6 @@ """ RETURN = r""" ---- cloudera_manager: description: Details about an active license type: dict @@ -78,6 +66,12 @@ returned: optional """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException +from cm_client import ClouderaManagerResourceApi + class ClouderaLicenseInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_resource.py b/plugins/modules/cm_resource.py index a50e768f..f6f3744a 100644 --- a/plugins/modules/cm_resource.py +++ b/plugins/modules/cm_resource.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,18 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_resource short_description: Create, update, and delete resources from the Cloudera Manager API endpoint description: @@ -56,7 +48,6 @@ """ EXAMPLES = r""" ---- - name: Create a new local Cloudera Manager user cloudera.cluster.cm_resource: host: example.cloudera.com @@ -90,7 +81,6 @@ """ RETURN = r""" ---- resources: description: - The results from the Cloudera Manager API endpoint call. @@ -100,6 +90,10 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + class ClouderaResource(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_resource_info.py b/plugins/modules/cm_resource_info.py index 39960c04..a196ba89 100644 --- a/plugins/modules/cm_resource_info.py +++ b/plugins/modules/cm_resource_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,18 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_resource_info short_description: Retrieve resources from the Cloudera Manager API endpoint description: @@ -61,7 +53,6 @@ """ RETURN = r""" ---- resources: description: - The results from the Cloudera Manager API endpoint call. @@ -71,6 +62,10 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + class ClouderaResourceInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_service_info.py b/plugins/modules/cm_service_info.py index 6d67e19e..10d07d28 100644 --- a/plugins/modules/cm_service_info.py +++ b/plugins/modules/cm_service_info.py @@ -338,7 +338,6 @@ - MGMT """ - from cm_client.rest import ApiException from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( diff --git a/plugins/modules/cm_service_role_config_group_info.py b/plugins/modules/cm_service_role_config_group_info.py index d4cffe5a..fb3a35d9 100644 --- a/plugins/modules/cm_service_role_config_group_info.py +++ b/plugins/modules/cm_service_role_config_group_info.py @@ -96,7 +96,6 @@ returned: always """ - from cm_client import ( ApiRoleConfigGroup, MgmtRoleConfigGroupsResourceApi, diff --git a/plugins/modules/cm_service_role_info.py b/plugins/modules/cm_service_role_info.py index a8aad2f5..f95634dd 100644 --- a/plugins/modules/cm_service_role_info.py +++ b/plugins/modules/cm_service_role_info.py @@ -205,7 +205,6 @@ returned: optional """ - from cm_client import ( MgmtServiceResourceApi, ) diff --git a/plugins/modules/cm_trial_license.py b/plugins/modules/cm_trial_license.py index 6988d0b2..07424e1d 100644 --- a/plugins/modules/cm_trial_license.py +++ b/plugins/modules/cm_trial_license.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,20 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException -from cm_client import ClouderaManagerResourceApi - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_trial_license short_description: Activate the trial license of Cloudera Manager description: @@ -39,7 +29,6 @@ """ EXAMPLES = r""" ---- - name: Activate the trial license of Cloudera Manager cloudera.cluster.cm_trial_license: host: example.cloudera.com @@ -49,7 +38,6 @@ """ RETURN = r""" ---- cloudera_manager: description: Details about trial license type: dict @@ -80,6 +68,12 @@ returned: optional """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException +from cm_client import ClouderaManagerResourceApi + class ClouderaTrial(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/cm_version_info.py b/plugins/modules/cm_version_info.py index 5017e41e..d711d4ba 100644 --- a/plugins/modules/cm_version_info.py +++ b/plugins/modules/cm_version_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2023 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,20 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from cm_client import ClouderaManagerResourceApi - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: cm_version_info short_description: Gather information about Cloudera Manager description: @@ -41,7 +31,6 @@ """ EXAMPLES = r""" ---- - name: Gather details using an endpoint URL cloudera.cluster.cm_version: url: "https://example.cloudera.com:7183/api/v49" @@ -60,7 +49,6 @@ """ RETURN = r""" ---- cloudera_manager: description: Details for the Cloudera Manager instance type: dict @@ -87,6 +75,12 @@ returned: optional """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from cm_client import ClouderaManagerResourceApi + class ClouderaManagerVersionInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/data_context.py b/plugins/modules/data_context.py index 8beab1ee..843e1608 100644 --- a/plugins/modules/data_context.py +++ b/plugins/modules/data_context.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,28 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerMutableModule, -) -from cm_client import DataContextsResourceApi, ApiDataContextList - -from cm_client import ( - ClustersResourceApi, - ApiDataContext, -) -from cm_client.rest import ApiException -from ansible_collections.cloudera.cluster.plugins.module_utils.data_context_utils import ( - parse_data_context_result, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: data_context short_description: Create, update, or delete a data context description: @@ -85,7 +67,6 @@ """ EXAMPLES = r""" ---- - name: Create a Data Context cloudera.cluster.data_context host: example.cloudera.com @@ -116,7 +97,6 @@ """ RETURN = r""" ---- data_context: description: - A dictionary containing details of data contexts within the cluster. @@ -181,6 +161,20 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerMutableModule, +) +from cm_client import DataContextsResourceApi, ApiDataContextList + +from cm_client import ( + ClustersResourceApi, + ApiDataContext, +) +from cm_client.rest import ApiException +from ansible_collections.cloudera.cluster.plugins.module_utils.data_context_utils import ( + parse_data_context_result, +) + class ClouderaDataContext(ClouderaManagerMutableModule): def __init__(self, module): diff --git a/plugins/modules/data_context_info.py b/plugins/modules/data_context_info.py index 22268e3f..f59d6662 100644 --- a/plugins/modules/data_context_info.py +++ b/plugins/modules/data_context_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,24 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerMutableModule, -) -from cm_client import DataContextsResourceApi, ApiDataContextRef, ApiDataContextList - -from cm_client.rest import ApiException -from ansible_collections.cloudera.cluster.plugins.module_utils.data_context_utils import ( - parse_data_context_result, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: data_context_info short_description: Retrieve details of data contexts description: @@ -50,7 +36,6 @@ """ EXAMPLES = r""" ---- - name: Gather details about specific data context cloudera.cluster.data_context_info host: example.cloudera.com @@ -66,7 +51,6 @@ """ RETURN = r""" ---- data_context_info: description: - List of data contexts within the cluster. @@ -131,6 +115,16 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerMutableModule, +) +from cm_client import DataContextsResourceApi, ApiDataContextRef, ApiDataContextList + +from cm_client.rest import ApiException +from ansible_collections.cloudera.cluster.plugins.module_utils.data_context_utils import ( + parse_data_context_result, +) + class ClouderaDataContextInfo(ClouderaManagerMutableModule): def __init__(self, module): diff --git a/plugins/modules/external_account.py b/plugins/modules/external_account.py index d4f49bc7..9023f8ae 100644 --- a/plugins/modules/external_account.py +++ b/plugins/modules/external_account.py @@ -15,21 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException -from cm_client import ( - ExternalAccountsResourceApi, - ApiExternalAccount, - ApiConfig, - ApiConfigList, -) -import json - - DOCUMENTATION = r""" ---- module: external_account short_description: Create, update, or delete an external module account description: @@ -131,8 +117,8 @@ requirements: - cm-client """ + EXAMPLES = r""" ---- - name: Create AWS Access key credentials cloudera.cluster.external_account: host: example.cloudera.com @@ -183,11 +169,9 @@ password: "S&peR4Ec*re" name: Jane state: absent - """ RETURN = r""" ---- external_account: description: Details of the external account created, updated, or retrieved. type: dict @@ -221,6 +205,19 @@ returned: always """ +import json + +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException +from cm_client import ( + ExternalAccountsResourceApi, + ApiExternalAccount, + ApiConfig, + ApiConfigList, +) + class ClouderaExternalAccount(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/external_account_info.py b/plugins/modules/external_account_info.py index 0da5e4cc..167d4adb 100644 --- a/plugins/modules/external_account_info.py +++ b/plugins/modules/external_account_info.py @@ -15,17 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException -from cm_client import ( - ExternalAccountsResourceApi, -) - - DOCUMENTATION = r""" ---- module: external_account_info short_description: Retrieve external account details details. description: @@ -63,7 +53,6 @@ """ EXAMPLES = r""" ---- - name: Get all external accounts in Cloudera Manager cloudera.cluster.external_account_info: host: example.cloudera.com @@ -86,11 +75,9 @@ username: "jane_smith" password: "S&peR4Ec*re" name: "aws_test_key" - """ RETURN = r""" ---- external_accounts: description: - List of one or more external accounts within the cluster. @@ -125,6 +112,14 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException +from cm_client import ( + ExternalAccountsResourceApi, +) + class ClouderaExternalAccountInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/external_user_mappings.py b/plugins/modules/external_user_mappings.py index 2e3c8ad9..3ba9e8a9 100644 --- a/plugins/modules/external_user_mappings.py +++ b/plugins/modules/external_user_mappings.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,24 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from cm_client import ( - ExternalUserMappingsResourceApi, - ApiExternalUserMapping, - ApiAuthRoleRef, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: external_user_mappings short_description: Create, update, or delete external user mappings description: @@ -89,7 +75,6 @@ """ EXAMPLES = r""" ---- - name: Create external user mapping with admin permissions cloudera.cluster.external_user_mappings: host: example.cloudera.com @@ -151,7 +136,6 @@ """ RETURN = r""" ---- external_user_mappings: description: - A dictionary containing details of external user mapping. @@ -181,6 +165,16 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from cm_client import ( + ExternalUserMappingsResourceApi, + ApiExternalUserMapping, + ApiAuthRoleRef, +) + class ClouderaExternalUserMappingsInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/external_user_mappings_info.py b/plugins/modules/external_user_mappings_info.py index 81dcccd6..afbd0dc4 100644 --- a/plugins/modules/external_user_mappings_info.py +++ b/plugins/modules/external_user_mappings_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,23 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from cm_client import ( - ExternalUserMappingsResourceApi, -) -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: external_user_mappings_info short_description: Retrieve details of external user mappings description: @@ -51,7 +38,6 @@ """ EXAMPLES = r""" ---- - name: Retrieve the defailts about a specific user mapping cloudera.cluster.external_user_mappings_info: host: example.cloudera.com @@ -74,7 +60,6 @@ """ RETURN = r""" ---- external_user_mappings_info: description: - List of external user mappings within the cloudera manager. @@ -104,6 +89,15 @@ returned: always """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from cm_client import ( + ExternalUserMappingsResourceApi, +) +from cm_client.rest import ApiException + class ClouderaExternalUserMappingsInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/host_config.py b/plugins/modules/host_config.py index 6ac0ca00..20a712e4 100644 --- a/plugins/modules/host_config.py +++ b/plugins/modules/host_config.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,27 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - -from cm_client import ( - HostsResourceApi, - ApiConfigList, - ApiConfig, -) -from cm_client.rest import ApiException - -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerMutableModule, - resolve_parameter_changeset, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: host_config short_description: Manage a host configuration in Cloudera Manager description: @@ -75,7 +58,6 @@ """ EXAMPLES = r""" ---- - name: Update host configuration parameters cloudera.cluster.host_config host: example.cloudera.com @@ -100,7 +82,6 @@ """ RETURN = r""" ---- config: description: - Configuration details about a specific host. @@ -180,6 +161,18 @@ returned: when supported """ +from cm_client import ( + HostsResourceApi, + ApiConfigList, + ApiConfig, +) +from cm_client.rest import ApiException + +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerMutableModule, + resolve_parameter_changeset, +) + class ClouderaHostConfigInfo(ClouderaManagerMutableModule): def __init__(self, module): diff --git a/plugins/modules/host_config_info.py b/plugins/modules/host_config_info.py index 49a0cd75..cac421b5 100644 --- a/plugins/modules/host_config_info.py +++ b/plugins/modules/host_config_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,20 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client import HostsResourceApi -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: host_config_info short_description: Retrieves the configuration details of a specific host. description: @@ -54,7 +44,6 @@ """ EXAMPLES = r""" ---- - name: Gather the configuration details for a host cloudera.cluster.host_config_info host: example.cloudera.com @@ -73,7 +62,6 @@ """ RETURN = r""" ---- config: description: Configuration details about a specific host. type: list @@ -152,6 +140,12 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client import HostsResourceApi +from cm_client.rest import ApiException + class ClouderaHostConfigInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/parcel.py b/plugins/modules/parcel.py index 2052e13a..b9d03aaf 100644 --- a/plugins/modules/parcel.py +++ b/plugins/modules/parcel.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,24 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from ansible_collections.cloudera.cluster.plugins.module_utils.parcel_utils import ( - Parcel, - parse_parcel_result, -) - -from cm_client import ClustersResourceApi, ParcelResourceApi -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" module: parcel short_description: Manage the state of parcels on a cluster @@ -181,6 +166,18 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from ansible_collections.cloudera.cluster.plugins.module_utils.parcel_utils import ( + Parcel, + parse_parcel_result, +) + +from cm_client import ClustersResourceApi, ParcelResourceApi +from cm_client.rest import ApiException + class ClouderaParcel(ClouderaManagerModule): diff --git a/plugins/modules/parcel_info.py b/plugins/modules/parcel_info.py index e2a862e6..92973b38 100644 --- a/plugins/modules/parcel_info.py +++ b/plugins/modules/parcel_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,23 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from ansible_collections.cloudera.cluster.plugins.module_utils.parcel_utils import ( - parse_parcel_result, -) - -from cm_client import ClustersResourceApi, ParcelResourceApi, ParcelsResourceApi -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" module: parcel_info short_description: Gather details about the parcels on the cluster @@ -119,6 +105,17 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from ansible_collections.cloudera.cluster.plugins.module_utils.parcel_utils import ( + parse_parcel_result, +) + +from cm_client import ClustersResourceApi, ParcelResourceApi, ParcelsResourceApi +from cm_client.rest import ApiException + class ClouderaParcelInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/service_config.py b/plugins/modules/service_config.py index 2f30ca2f..ccf9357c 100644 --- a/plugins/modules/service_config.py +++ b/plugins/modules/service_config.py @@ -204,7 +204,6 @@ ServiceConfigUpdates, ) - from cm_client import ( ClustersResourceApi, ServicesResourceApi, diff --git a/plugins/modules/service_config_info.py b/plugins/modules/service_config_info.py index 969e0f93..0eeec66f 100644 --- a/plugins/modules/service_config_info.py +++ b/plugins/modules/service_config_info.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2024 Cloudera, Inc. All Rights Reserved. @@ -14,24 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from cm_client import ( - ClustersResourceApi, - ServicesResourceApi, -) -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: service_config_info short_description: Retrieve information about the configuration for a cluster service description: @@ -70,7 +54,6 @@ """ EXAMPLES = r""" ---- - name: Gather the configuration details for a cluster service cloudera.cluster.service_config_info: host: "example.cloudera.host" @@ -90,7 +73,6 @@ """ RETURN = r""" ---- config: description: Service-wide configuration details about a cluster service. type: list @@ -169,6 +151,16 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from cm_client import ( + ClustersResourceApi, + ServicesResourceApi, +) +from cm_client.rest import ApiException + class ClusterServiceConfigInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/service_role_config.py b/plugins/modules/service_role_config.py index 0a67fd94..ad159ecf 100644 --- a/plugins/modules/service_role_config.py +++ b/plugins/modules/service_role_config.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2024 Cloudera, Inc. All Rights Reserved. @@ -14,30 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json - -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerMutableModule, - resolve_parameter_changeset, -) - -from cm_client import ( - ApiConfig, - ApiConfigList, - ClustersResourceApi, - RolesResourceApi, - ServicesResourceApi, -) -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: service_role_config short_description: Manage a service role configuration in cluster description: @@ -99,7 +77,6 @@ """ EXAMPLES = r""" ---- - name: Update (append) role parameters cloudera.cluster.service_role_config: host: example.cloudera.com @@ -145,7 +122,6 @@ """ RETURN = r""" ---- config: description: - List of Cloudera Manager configurations. @@ -224,6 +200,22 @@ returned: when supported """ +import json + +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerMutableModule, + resolve_parameter_changeset, +) + +from cm_client import ( + ApiConfig, + ApiConfigList, + ClustersResourceApi, + RolesResourceApi, + ServicesResourceApi, +) +from cm_client.rest import ApiException + class ClusterServiceRoleConfig(ClouderaManagerMutableModule): def __init__(self, module): diff --git a/plugins/modules/service_role_config_group_config.py b/plugins/modules/service_role_config_group_config.py index 605e8546..f56a7eb3 100644 --- a/plugins/modules/service_role_config_group_config.py +++ b/plugins/modules/service_role_config_group_config.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2024 Cloudera, Inc. All Rights Reserved. @@ -14,30 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json - -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerMutableModule, - resolve_parameter_changeset, -) - -from cm_client import ( - ApiConfig, - ApiConfigList, - ClustersResourceApi, - RoleConfigGroupsResourceApi, - ServicesResourceApi, -) -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: service_role_config_group_config short_description: Manage the configuration of a cluster service role config group. description: @@ -101,7 +79,6 @@ """ EXAMPLES = r""" ---- - name: Update (append) several role config group parameters cloudera.cluster.service_role_config_group_config: host: example.cloudera.com @@ -147,7 +124,6 @@ """ RETURN = r""" ---- config: description: - List of configurations for a service role config group. @@ -225,6 +201,22 @@ returned: when supported """ +import json + +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerMutableModule, + resolve_parameter_changeset, +) + +from cm_client import ( + ApiConfig, + ApiConfigList, + ClustersResourceApi, + RoleConfigGroupsResourceApi, + ServicesResourceApi, +) +from cm_client.rest import ApiException + class ClusterServiceRoleConfigGroupConfig(ClouderaManagerMutableModule): def __init__(self, module): diff --git a/plugins/modules/service_role_config_group_config_info.py b/plugins/modules/service_role_config_group_config_info.py index ba25a6cb..1914b97a 100644 --- a/plugins/modules/service_role_config_group_config_info.py +++ b/plugins/modules/service_role_config_group_config_info.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2024 Cloudera, Inc. All Rights Reserved. @@ -14,26 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from cm_client import ( - ClustersResourceApi, - RoleConfigGroupsResourceApi, - ServicesResourceApi, -) -from cm_client.rest import ApiException - - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: service_role_config_group_config_info short_description: Retrieve the configuration of a cluster service role config group. description: @@ -79,7 +61,6 @@ """ EXAMPLES = r""" ---- - name: Gather the configuration details for a cluster service role config group cloudera.cluster.service_role_config_group_config_info: host: "example.cloudera.internal" @@ -101,7 +82,6 @@ """ RETURN = r""" ---- config: description: - List of configurations for a service role config group. @@ -179,6 +159,17 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from cm_client import ( + ClustersResourceApi, + RoleConfigGroupsResourceApi, + ServicesResourceApi, +) +from cm_client.rest import ApiException + class ClusterServiceRoleConfigGroupConfigInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/service_role_config_group_info.py b/plugins/modules/service_role_config_group_info.py index 02a1ac25..73324c71 100644 --- a/plugins/modules/service_role_config_group_info.py +++ b/plugins/modules/service_role_config_group_info.py @@ -1,5 +1,4 @@ #!/usr/bin/python -#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2025 Cloudera, Inc. All Rights Reserved. @@ -59,7 +58,6 @@ description: - The role config group to examine. - If defined, the module will return the role config group. - - If defined, the module will return the role config group. - If the role config group does not exist, the module will return an empty result. type: str aliases: @@ -108,28 +106,23 @@ role_config_groups: description: - List of cluster service role config groups. - - List of cluster service role config groups. type: list elements: dict returned: always contains: name: - description: Name (identifier) of the role config group. description: Name (identifier) of the role config group. type: str returned: always role_type: - description: The type of the roles in this role config group. description: The type of the roles in this role config group. type: str returned: always base: - description: Flag indicating whether this is a base role config group. description: Flag indicating whether this is a base role config group. type: bool returned: always display_name: - description: A user-friendly name of the role config group, as would have been shown in the web UI. description: A user-friendly name of the role config group, as would have been shown in the web UI. type: str returned: when supported diff --git a/plugins/modules/service_role_config_info.py b/plugins/modules/service_role_config_info.py index c66f3979..5ddb21ed 100644 --- a/plugins/modules/service_role_config_info.py +++ b/plugins/modules/service_role_config_info.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2024 Cloudera, Inc. All Rights Reserved. @@ -14,25 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from cm_client import ( - ClustersResourceApi, - RolesResourceApi, - ServicesResourceApi, -) -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: service_role_config_info short_description: Retrieve information about the configuration for a cluster service role description: @@ -79,7 +62,6 @@ """ EXAMPLES = r""" ---- - name: Gather the configuration details for a cluster service role cloudera.cluster.service_role_config_info: host: "example.cloudera.internal" @@ -101,7 +83,6 @@ """ RETURN = r""" ---- config: description: - List of service role configurations. @@ -179,6 +160,17 @@ returned: when supported """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from cm_client import ( + ClustersResourceApi, + RolesResourceApi, + ServicesResourceApi, +) +from cm_client.rest import ApiException + class ClusterServiceRoleConfigInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/service_role_info.py b/plugins/modules/service_role_info.py index 439e87ea..46607135 100644 --- a/plugins/modules/service_role_info.py +++ b/plugins/modules/service_role_info.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# # -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # Copyright 2025 Cloudera, Inc. All Rights Reserved. # diff --git a/plugins/modules/service_type_info.py b/plugins/modules/service_type_info.py index 0f7ad43a..9fa3b37c 100644 --- a/plugins/modules/service_type_info.py +++ b/plugins/modules/service_type_info.py @@ -14,21 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) - -from cm_client import ClustersResourceApi -from cm_client.rest import ApiException - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: service_type_info short_description: Retrieve the service types of a cluster description: @@ -51,7 +37,6 @@ """ EXAMPLES = r""" ---- - name: Gather service type details cloudera.cluster.service_type_info: host: "example.cloudera.host" @@ -62,7 +47,6 @@ """ RETURN = r""" ---- service_types: description: List of the service types available in the cluster. type: list @@ -73,6 +57,13 @@ - ICEBERG_REPLICATION """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) + +from cm_client import ClustersResourceApi +from cm_client.rest import ApiException + class ClusterServiceTypeInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/user.py b/plugins/modules/user.py index dcb53c16..48c5d3fe 100644 --- a/plugins/modules/user.py +++ b/plugins/modules/user.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,26 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException -from cm_client import ( - UsersResourceApi, - ApiUser2, - ApiAuthRoleRef, - ApiUser2List, - AuthRolesResourceApi, -) - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: user short_description: Create, delete or update users within Cloudera Manager description: @@ -80,7 +64,6 @@ """ EXAMPLES = r""" ---- - name: Create new Administrator user cloudera.cluster.user: host: example.cloudera.com @@ -125,11 +108,9 @@ account_name: "john" roles: ["Dashboard User"] state: "absent" - """ RETURN = r""" ---- user: description: Details of a single user within the cluster type: dict @@ -146,6 +127,18 @@ returned: optional """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException +from cm_client import ( + UsersResourceApi, + ApiUser2, + ApiAuthRoleRef, + ApiUser2List, + AuthRolesResourceApi, +) + class ClouderaUserInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/plugins/modules/user_info.py b/plugins/modules/user_info.py index b831d81c..08cdd2a4 100644 --- a/plugins/modules/user_info.py +++ b/plugins/modules/user_info.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + # Copyright 2024 Cloudera, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,20 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( - ClouderaManagerModule, -) -from cm_client.rest import ApiException -from cm_client import UsersResourceApi - -ANSIBLE_METADATA = { - "metadata_version": "1.1", - "status": ["preview"], - "supported_by": "community", -} - DOCUMENTATION = r""" ---- module: user_info short_description: Retrieve user details and associated authentication roles. description: @@ -44,7 +34,6 @@ """ EXAMPLES = r""" ---- - name: Get list of all users in Cloudera Manager cloudera.cluster.user_info: host: example.cloudera.com @@ -63,7 +52,6 @@ """ RETURN = r""" ---- users: description: - Retrieve details of single user or all users within the Cloudera Manager @@ -81,6 +69,12 @@ returned: optional """ +from ansible_collections.cloudera.cluster.plugins.module_utils.cm_utils import ( + ClouderaManagerModule, +) +from cm_client.rest import ApiException +from cm_client import UsersResourceApi + class ClouderaUserInfo(ClouderaManagerModule): def __init__(self, module): diff --git a/requirements.txt b/requirements.txt index 557edfa4..dd06b761 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,5 +19,4 @@ jmespath cm-client # For cm_license lookup - python-gnupg diff --git a/tests/return-values-cm_service.yml b/tests/return-values-cm_service.yml deleted file mode 100644 index 3c6469fe..00000000 --- a/tests/return-values-cm_service.yml +++ /dev/null @@ -1,303 +0,0 @@ -# Copyright 2025 Cloudera, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -service: - description: The Cloudera Manager service. - type: dict - contains: - client_config_staleness_status: - description: Status of client configuration for the Cloudera Manager service. - type: str - returned: optional - cluster_name: - description: The associated cluster name. - type: str - returned: optional - config: - description: Service-wide configuration for the Cloudera Manager service. - type: dict - returned: optional - config_staleness_status: - description: Status of configuration staleness for the Cloudera Manager service. - type: str - returned: optional - sample: - - FRESH - - STALE_REFRESHABLE - - STALE - display_name: - description: Display name of the Cloudera Manager service. - type: str - returned: always - health_checks: - description: Lists all available health checks for the Cloudera Manager service. - type: list - elements: dict - returned: optional - contains: - explanation: - description: A descriptor for the health check. - type: str - returned: optional - name: - description: Unique name fore the health check. - type: str - returned: always - summary: - description: The summary status of the health check. - type: str - returned: always - sample: - - DISABLED - - HISTORY_NOT_AVAILABLE - - NOT_AVAILABLE - - GOOD - - CONCERNING - - BAD - suppressed: - description: - - Whether the health check is suppressed. - - A suppressed health check is not considered when computing the overall health. - type: bool - returned: always - health_summary: - description: Health of the Cloudera Manager service. - type: str - returned: always - sample: - - DISABLED - - HISTORY_NOT_AVAILABLE - - NOT_AVAILABLE - - GOOD - - CONCERNING - - BAD - maintenance_mode: - description: Whether maintance mode is enabled for the Cloudera Manager service. - type: bool - returned: always - maintenance_owners: - description: List of objects that trigger the Cloudera Manager service to be in maintenance mode. - type: list - elements: str - returned: optional - sample: - - CLUSTER - - SERVICE - - ROLE - - HOST - - CONTROL_PLANE - name: - description: Name (identifier) of the Cloudera Manager service. - type: str - returned: always - role_config_groups: - description: List of role configuration groups for Cloudera Manager service. - type: list - elements: dict - returned: optional - contains: - base: - description: Whether the role config group is a base (default) group. - type: bool - returned: always - config: - description: Configuration for the role config group. - type: dict - returned: optional - display_name: - description: Display name for the role config group. - type: str - returned: always - name: - description: Name (identifier) of the role config group. - type: str - returned: always - role_type: - description: The type of roles in this group. - type: str - returned: always - service_name: - description: Name (identifier) of the associated service of the role config group. - type: str - returned: always - roles: - description: List of role instances for Cloudera Manager service. - type: list - elements: dict - returned: optional - contains: - commission_state: - description: Commission state of the Cloudera Manager service role. - type: str - returned: always - sample: - - COMMISSIONED - - DECOMMISSIONING - - DECOMMISSIONED - - UNKNOWN - - OFFLINING - - OFFLINED - config: - description: Role override configuration for the Cloudera Manager service. - type: dict - returned: optional - config_staleness_status: - description: Status of configuration staleness for the Cloudera Manager service role. - type: str - returned: always - sample: - - FRESH - - STALE_REFRESHABLE - - STALE - ha_status: - description: High-availability status for the Cloudera Manager service. - type: str - returned: optional - sample: - - ACTIVE - - STANDBY - - UNKNOWN - health_checks: - description: List of all available health checks for Cloudera Manager service role. - type: list - elements: dict - returned: optional - contains: - explanation: - description: The explanation of this health check. - type: str - returned: optional - name: - description: Unique name of this health check. - type: str - returned: always - summary: - description: The high-level health status of the health check. - type: str - returned: always - sample: - - DISABLED - - HISTORY_NOT_AVAILABLE - - NOT_AVAILABLE - - GOOD - - CONCERNING - - BAD - suppressed: - description: - - Whether this health check is suppressed. - - A suppressed health check is not considered when computing the role's overall health. - type: bool - returned: optional - health_summary: - description: The high-level health status of the Cloudera Manager service role. - type: str - returned: always - sample: - - DISABLED - - HISTORY_NOT_AVAILABLE - - NOT_AVAILABLE - - GOOD - - CONCERNING - - BAD - host_id: - description: The unique ID of the cluster host. - type: str - returned: always - maintenance_mode: - description: Whether the Cloudera Manager service role is in maintenance mode. - type: bool - returned: always - maintenance_owners: - description: List of objects that trigger the Cloudera Manager service role to be in maintenance mode. - type: list - elements: str - returned: optional - sample: - - CLUSTER - - SERVICE - - ROLE - - HOST - - CONTROL_PLANE - name: - description: - - The Cloudera Manager service role name. - - Note, this is an auto-generated name and cannot be changed. - type: str - returned: always - role_config_group_name: - description: The name of the Cloudera Manager Service role config group, which uniquely identifies it in a Cloudera Manager installation. - type: str - returned: always - role_state: - description: State of the Cloudera Manager service role. - type: str - returned: always - sample: - - HISTORY_NOT_AVAILABLE - - UNKNOWN - - STARTING - - STARTED - - STOPPING - - STOPPED - - NA - service_name: - description: The name of the Cloudera Manager service, which uniquely identifies it in a deployment. - type: str - returned: always - tags: - description: Set of tags for the Cloudera Manager service role. - type: dict - returned: optional - type: - description: The Cloudera Manager service role type. - type: str - returned: always - sample: - - HOSTMONITOR - - ALERTPUBLISHER - - SERVICEMONITOR - - REPORTSMANAGER - - EVENTSERVER - zoo_keeper_server_mode: - description: - - The Zookeeper server mode for this Cloudera Manager service role. - - Note that for non-Zookeeper Server roles, this will be V(null). - type: str - returned: optional - service_state: - description: Run state of the Cloudera Manager service. - type: str - returned: always - sample: - - HISTORY_NOT_AVAILABLE - - UNKNOWN - - STARTING - - STARTED - - STOPPING - - STOPPED - - NA - service_version: - description: Version of Cloudera Manager service. - type: str - returned: always - tags: - description: List of tags for Cloudera Manager service. - type: list - returned: optional - type: - description: Type of the Cloudera Manager service, i.e. MGMT. - type: str - returned: always - sample: - - MGMT diff --git a/tests/return-values-cm_service_role.yml b/tests/return-values-cm_service_role.yml deleted file mode 100644 index f91235a7..00000000 --- a/tests/return-values-cm_service_role.yml +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright 2025 Cloudera, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -role: - description: Details about the Cloudera Manager service role. - type: dict - returned: always - contains: - commission_state: - description: Commission state of the Cloudera Manager service role. - type: str - returned: always - sample: - - COMMISSIONED - - DECOMMISSIONING - - DECOMMISSIONED - - UNKNOWN - - OFFLINING - - OFFLINED - config: - description: Role override configuration for the Cloudera Manager service. - type: dict - returned: optional - config_staleness_status: - description: Status of configuration staleness for the Cloudera Manager service role. - type: str - returned: always - sample: - - FRESH - - STALE_REFRESHABLE - - STALE - ha_status: - description: High-availability status for the Cloudera Manager service. - type: str - returned: optional - sample: - - ACTIVE - - STANDBY - - UNKNOWN - health_checks: - description: List of all available health checks for Cloudera Manager service role. - type: list - elements: dict - returned: optional - contains: - explanation: - description: The explanation of this health check. - type: str - returned: optional - name: - description: Unique name of this health check. - type: str - returned: always - summary: - description: The high-level health status of the health check. - type: str - returned: always - sample: - - DISABLED - - HISTORY_NOT_AVAILABLE - - NOT_AVAILABLE - - GOOD - - CONCERNING - - BAD - suppressed: - description: - - Whether this health check is suppressed. - - A suppressed health check is not considered when computing the role's overall health. - type: bool - returned: optional - health_summary: - description: The high-level health status of the Cloudera Manager service role. - type: str - returned: always - sample: - - DISABLED - - HISTORY_NOT_AVAILABLE - - NOT_AVAILABLE - - GOOD - - CONCERNING - - BAD - host_id: - description: The unique ID of the cluster host. - type: str - returned: always - maintenance_mode: - description: Whether the Cloudera Manager service role is in maintenance mode. - type: bool - returned: always - maintenance_owners: - description: List of objects that trigger the Cloudera Manager service role to be in maintenance mode. - type: list - elements: str - returned: optional - sample: - - CLUSTER - - SERVICE - - ROLE - - HOST - - CONTROL_PLANE - name: - description: - - The Cloudera Manager service role name. - - Note, this is an auto-generated name and cannot be changed. - type: str - returned: always - role_config_group_name: - description: The name of the Cloudera Manager Service role config group, which uniquely identifies it in a Cloudera Manager installation. - type: str - returned: always - role_state: - description: State of the Cloudera Manager service role. - type: str - returned: always - sample: - - HISTORY_NOT_AVAILABLE - - UNKNOWN - - STARTING - - STARTED - - STOPPING - - STOPPED - - NA - service_name: - description: The name of the Cloudera Manager service, which uniquely identifies it in a deployment. - type: str - returned: always - tags: - description: Set of tags for the Cloudera Manager service role. - type: dict - returned: optional - type: - description: The Cloudera Manager service role type. - type: str - returned: always - sample: - - HOSTMONITOR - - ALERTPUBLISHER - - SERVICEMONITOR - - REPORTSMANAGER - - EVENTSERVER - zoo_keeper_server_mode: - description: - - The Zookeeper server mode for this Cloudera Manager service role. - - Note that for non-Zookeeper Server roles, this will be V(null). - type: str - returned: optional diff --git a/tests/return-values-cm_service_role_config_group.yml b/tests/return-values-cm_service_role_config_group.yml deleted file mode 100644 index 9b09b813..00000000 --- a/tests/return-values-cm_service_role_config_group.yml +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2025 Cloudera, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -role_config_group: - description: A Cloudera Manager service role config group. - type: dict - returned: always - contains: - base: - description: Whether the role config group is a base group. - type: bool - returned: always - config: - description: Set of configurations for the role config group. - type: dict - returned: optional - display_name: - description: Display name of the role config group. - type: str - returned: always - name: - description: Name (identifier) of the role config group. - type: str - returned: always - role_names: - description: List of role names (identifiers) associated with this role config group. - type: list - elements: str - returned: optional - role_type: - description: The type of the roles in this role config group. - type: str - returned: always - service_name: - description: Service name associated with this role config group. - type: str - returned: always