Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,13 @@ plugin_routing:
deprecation:
removal_version: "5.0.0"
warning_text: Use M(cloudera.cluster.role_info).
service_role_config_group:
redirect: cloudera.cluster.role_config_group
deprecation:
removal_version: "5.0.0"
warning_text: Use M(cloudera.cluster.role_config_group).
service_role_config_group_info:
redirect: cloudera.cluster.role_config_group_info
deprecation:
removal_version: "5.0.0"
warning_text: Use M(cloudera.cluster.role_config_group_info).
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# limitations under the License.

DOCUMENTATION = r"""
module: service_role_config_group
module: role_config_group
short_description: Manage a cluster service role config group.
description:
- Manage a cluster service role config group.
Expand Down Expand Up @@ -103,12 +103,12 @@
requirements:
- cm-client
seealso:
- module: cloudera.cluster.service_role_config_group_info
- module: cloudera.cluster.role_config_group_info
"""

EXAMPLES = r"""
- name: Create or update a role config group
cloudera.cluster.service_role_config_group:
cloudera.cluster.role_config_group:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -120,7 +120,7 @@
tickTime: 2500

- name: Create or update a role config group, purging undeclared parameters
cloudera.cluster.service_role_config_group:
cloudera.cluster.role_config_group:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -133,7 +133,7 @@
purge: true

- name: Update the base role config group for a role type
cloudera.cluster.service_role_config_group:
cloudera.cluster.role_config_group:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -145,7 +145,7 @@
tickTime: 3500

- name: Reset the configuration of a role config group
cloudera.cluster.service_role_config_group:
cloudera.cluster.role_config_group:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand Down Expand Up @@ -206,7 +206,6 @@
"""

from cm_client import (
ApiConfigList,
ApiRoleConfigGroup,
ApiRoleConfigGroupList,
ClustersResourceApi,
Expand All @@ -227,9 +226,9 @@
)


class ClusterServiceRoleConfig(ClouderaManagerMutableModule):
class RoleConfigGroup(ClouderaManagerMutableModule):
def __init__(self, module):
super(ClusterServiceRoleConfig, self).__init__(module)
super(RoleConfigGroup, self).__init__(module)

# Set the parameters
self.cluster = self.get_param("cluster")
Expand Down Expand Up @@ -406,20 +405,6 @@ def process(self):
config=self.config,
)

# payload = ApiRoleConfigGroup(
# name=self.name,
# role_type=self.role_type,
# )

# if self.display_name:
# payload.display_name = self.display_name

# # Set the configuration
# if self.config:
# payload.config = ConfigListUpdates(
# ApiConfigList(items=[]), self.config, self.purge
# ).config

if self.module._diff:
self.diff = dict(
before={},
Expand Down Expand Up @@ -473,7 +458,7 @@ def main():
supports_check_mode=True,
)

result = ClusterServiceRoleConfig(module)
result = RoleConfigGroup(module)

output = dict(
changed=result.changed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# limitations under the License.

DOCUMENTATION = r"""
module: service_role_config_group_info
module: role_config_group_info
short_description: Retrieve information about a cluster service role config group or groups
description:
- Gather details about a role config group or groups of a service in a CDP cluster.
Expand Down Expand Up @@ -51,6 +51,7 @@
- The role config group to examine.
- 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.
- Mutually exclusive with O(type).
type: str
aliases:
- role_config_group
Expand All @@ -64,28 +65,35 @@
requirements:
- cm-client
seealso:
- module: cloudera.cluster.service_role_config_group
- module: cloudera.cluster.role_config_group
"""

EXAMPLES = r"""
- name: Gather the configuration details for a cluster service role
cloudera.cluster.service_role_config_info:
- name: Gather the configuration details for all role config groups for a service
cloudera.cluster.role_config_group_info:
host: "example.cloudera.internal"
username: "jane_person"
password: "S&peR4Ec*re"
cluster: ExampleCluster
service: knox
role: GATEWAY

- name: Gather the configuration details in 'full' for a cluster service role
cloudera.cluster.service_role_config_info:
- name: Gather the configuration details for a base role config group
cloudera.cluster.role_config_group_info:
host: "example.cloudera.internal"
username: "jane_person"
password: "S&peR4Ec*re"
cluster: ExampleCluster
service: ecs
role: ECS
view: full
service: knox
type: GATEWAY

- name: Gather the configuration details for a custom role config group
cloudera.cluster.role_config_group_info:
host: "example.cloudera.internal"
username: "jane_person"
password: "S&peR4Ec*re"
cluster: ExampleCluster
service: knox
name: custom_rcg_knox_gateway
"""

RETURN = r"""
Expand Down Expand Up @@ -136,13 +144,12 @@

from ansible_collections.cloudera.cluster.plugins.module_utils.role_config_group_utils import (
parse_role_config_group_result,
get_base_role_config_group,
)


class ClusterServiceRoleConfigGroupInfo(ClouderaManagerModule):
class RoleConfigGroupInfo(ClouderaManagerModule):
def __init__(self, module):
super(ClusterServiceRoleConfigGroupInfo, self).__init__(module)
super(RoleConfigGroupInfo, self).__init__(module)

# Set the parameters
self.cluster = self.get_param("cluster")
Expand Down Expand Up @@ -239,7 +246,7 @@ def main():
supports_check_mode=True,
)

result = ClusterServiceRoleConfigGroupInfo(module)
result = RoleConfigGroupInfo(module)

output = dict(
changed=False,
Expand Down
Loading
Loading