Skip to content

Commit 4b79d8f

Browse files
committed
Rename service_role_config_group and service_role_config_group_info to role_config_group and role_config_group_info
Signed-off-by: Webster Mudge <[email protected]>
1 parent 4ab40f4 commit 4b79d8f

File tree

5 files changed

+81
-76
lines changed

5 files changed

+81
-76
lines changed

meta/runtime.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,16 @@ action_groups:
8686
- host
8787
- host_template
8888
- parcel
89+
90+
plugin_routing:
91+
modules:
92+
service_role_config_group:
93+
redirect: cloudera.cluster.role_config_group
94+
deprecation:
95+
removal_version: "5.0.0"
96+
warning_text: Use M(cloudera.cluster.role_config_group).
97+
service_role_config_group_info:
98+
redirect: cloudera.cluster.role_config_group_info
99+
deprecation:
100+
removal_version: "5.0.0"
101+
warning_text: Use M(cloudera.cluster.role_config_group_info).

plugins/modules/service_role_config_group.py renamed to plugins/modules/role_config_group.py

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# limitations under the License.
1717

1818
DOCUMENTATION = r"""
19-
module: service_role_config_group
19+
module: role_config_group
2020
short_description: Manage a cluster service role config group.
2121
description:
2222
- Manage a cluster service role config group.
@@ -103,12 +103,12 @@
103103
requirements:
104104
- cm-client
105105
seealso:
106-
- module: cloudera.cluster.service_role_config_group_info
106+
- module: cloudera.cluster.role_config_group_info
107107
"""
108108

109109
EXAMPLES = r"""
110110
- name: Create or update a role config group
111-
cloudera.cluster.service_role_config_group:
111+
cloudera.cluster.role_config_group:
112112
host: example.cloudera.com
113113
username: "jane_smith"
114114
password: "S&peR4Ec*re"
@@ -120,7 +120,7 @@
120120
tickTime: 2500
121121
122122
- name: Create or update a role config group, purging undeclared parameters
123-
cloudera.cluster.service_role_config_group:
123+
cloudera.cluster.role_config_group:
124124
host: example.cloudera.com
125125
username: "jane_smith"
126126
password: "S&peR4Ec*re"
@@ -133,7 +133,7 @@
133133
purge: true
134134
135135
- name: Update the base role config group for a role type
136-
cloudera.cluster.service_role_config_group:
136+
cloudera.cluster.role_config_group:
137137
host: example.cloudera.com
138138
username: "jane_smith"
139139
password: "S&peR4Ec*re"
@@ -145,7 +145,7 @@
145145
tickTime: 3500
146146
147147
- name: Reset the configuration of a role config group
148-
cloudera.cluster.service_role_config_group:
148+
cloudera.cluster.role_config_group:
149149
host: example.cloudera.com
150150
username: "jane_smith"
151151
password: "S&peR4Ec*re"
@@ -206,7 +206,6 @@
206206
"""
207207

208208
from cm_client import (
209-
ApiConfigList,
210209
ApiRoleConfigGroup,
211210
ApiRoleConfigGroupList,
212211
ClustersResourceApi,
@@ -227,9 +226,9 @@
227226
)
228227

229228

230-
class ClusterServiceRoleConfig(ClouderaManagerMutableModule):
229+
class RoleConfigGroup(ClouderaManagerMutableModule):
231230
def __init__(self, module):
232-
super(ClusterServiceRoleConfig, self).__init__(module)
231+
super(RoleConfigGroup, self).__init__(module)
233232

234233
# Set the parameters
235234
self.cluster = self.get_param("cluster")
@@ -406,20 +405,6 @@ def process(self):
406405
config=self.config,
407406
)
408407

409-
# payload = ApiRoleConfigGroup(
410-
# name=self.name,
411-
# role_type=self.role_type,
412-
# )
413-
414-
# if self.display_name:
415-
# payload.display_name = self.display_name
416-
417-
# # Set the configuration
418-
# if self.config:
419-
# payload.config = ConfigListUpdates(
420-
# ApiConfigList(items=[]), self.config, self.purge
421-
# ).config
422-
423408
if self.module._diff:
424409
self.diff = dict(
425410
before={},
@@ -473,7 +458,7 @@ def main():
473458
supports_check_mode=True,
474459
)
475460

476-
result = ClusterServiceRoleConfig(module)
461+
result = RoleConfigGroup(module)
477462

478463
output = dict(
479464
changed=result.changed,

plugins/modules/service_role_config_group_info.py renamed to plugins/modules/role_config_group_info.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# limitations under the License.
1717

1818
DOCUMENTATION = r"""
19-
module: service_role_config_group_info
19+
module: role_config_group_info
2020
short_description: Retrieve information about a cluster service role config group or groups
2121
description:
2222
- Gather details about a role config group or groups of a service in a CDP cluster.
@@ -51,6 +51,7 @@
5151
- The role config group to examine.
5252
- If defined, the module will return the role config group.
5353
- If the role config group does not exist, the module will return an empty result.
54+
- Mutually exclusive with O(type).
5455
type: str
5556
aliases:
5657
- role_config_group
@@ -64,28 +65,35 @@
6465
requirements:
6566
- cm-client
6667
seealso:
67-
- module: cloudera.cluster.service_role_config_group
68+
- module: cloudera.cluster.role_config_group
6869
"""
6970

7071
EXAMPLES = r"""
71-
- name: Gather the configuration details for a cluster service role
72-
cloudera.cluster.service_role_config_info:
72+
- name: Gather the configuration details for all role config groups for a service
73+
cloudera.cluster.role_config_group_info:
7374
host: "example.cloudera.internal"
7475
username: "jane_person"
7576
password: "S&peR4Ec*re"
7677
cluster: ExampleCluster
7778
service: knox
78-
role: GATEWAY
7979
80-
- name: Gather the configuration details in 'full' for a cluster service role
81-
cloudera.cluster.service_role_config_info:
80+
- name: Gather the configuration details for a base role config group
81+
cloudera.cluster.role_config_group_info:
8282
host: "example.cloudera.internal"
8383
username: "jane_person"
8484
password: "S&peR4Ec*re"
8585
cluster: ExampleCluster
86-
service: ecs
87-
role: ECS
88-
view: full
86+
service: knox
87+
type: GATEWAY
88+
89+
- name: Gather the configuration details for a custom role config group
90+
cloudera.cluster.role_config_group_info:
91+
host: "example.cloudera.internal"
92+
username: "jane_person"
93+
password: "S&peR4Ec*re"
94+
cluster: ExampleCluster
95+
service: knox
96+
name: custom_rcg_knox_gateway
8997
"""
9098

9199
RETURN = r"""
@@ -136,13 +144,12 @@
136144

137145
from ansible_collections.cloudera.cluster.plugins.module_utils.role_config_group_utils import (
138146
parse_role_config_group_result,
139-
get_base_role_config_group,
140147
)
141148

142149

143-
class ClusterServiceRoleConfigGroupInfo(ClouderaManagerModule):
150+
class RoleConfigGroupInfo(ClouderaManagerModule):
144151
def __init__(self, module):
145-
super(ClusterServiceRoleConfigGroupInfo, self).__init__(module)
152+
super(RoleConfigGroupInfo, self).__init__(module)
146153

147154
# Set the parameters
148155
self.cluster = self.get_param("cluster")
@@ -239,7 +246,7 @@ def main():
239246
supports_check_mode=True,
240247
)
241248

242-
result = ClusterServiceRoleConfigGroupInfo(module)
249+
result = RoleConfigGroupInfo(module)
243250

244251
output = dict(
245252
changed=False,

0 commit comments

Comments
 (0)