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
11 changes: 11 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,14 @@ plugin_routing:
deprecation:
removal_version: "6.0.0"
warning_text: Use M(cloudera.cluster.cm_resource).
modules:
service_role:
redirect: cloudera.cluster.role
deprecation:
removal_version: "5.0.0"
warning_text: Use M(cloudera.cluster.role).
service_role_info:
redirect: cloudera.cluster.role_info
deprecation:
removal_version: "5.0.0"
warning_text: Use M(cloudera.cluster.role_info).
26 changes: 13 additions & 13 deletions plugins/modules/service_role.py → plugins/modules/role.py
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
module: role
short_description: Manage a service role in cluster
description:
- Manage a service role in a cluster.
Expand Down Expand Up @@ -134,12 +134,12 @@
requirements:
- cm-client
seealso:
- module: cloudera.cluster.service_role_info
- module: cloudera.cluster.role_info
"""

EXAMPLES = r"""
- name: Provision a service role
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -149,7 +149,7 @@
cluster_hostname: worker-01.cloudera.internal

- name: Set a service role to maintenance mode (using role name)
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -159,7 +159,7 @@
maintenance: true

- name: Update (append) tags to a service role
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -172,7 +172,7 @@
tag_two: value_two

- name: Set (purge) tags to a service role
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
cluster: example-cluster
Expand All @@ -184,7 +184,7 @@
purge: true

- name: Remove all tags on a service role
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -196,7 +196,7 @@
purge: true

- name: Start a service role
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -207,7 +207,7 @@
state: started

- name: Force a restart to a service role
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand All @@ -218,7 +218,7 @@
state: restarted

- name: Remove a service role
cloudera.cluster.service_role:
cloudera.cluster.role:
host: example.cloudera.com
username: "jane_smith"
password: "S&peR4Ec*re"
Expand Down Expand Up @@ -389,9 +389,9 @@
)


class ClusterServiceRole(ClouderaManagerMutableModule):
class Role(ClouderaManagerMutableModule):
def __init__(self, module):
super(ClusterServiceRole, self).__init__(module)
super(Role, self).__init__(module)

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

result = ClusterServiceRole(module)
result = Role(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_info
module: role_info
short_description: Retrieve information about the service roles of cluster
description:
- Gather information about one or all service roles of a CDP cluster.
Expand Down Expand Up @@ -85,20 +85,20 @@
requirements:
- cm_client
seealso:
- module: cloudera.cluster.service_role
- module: cloudera.cluster.role
"""

EXAMPLES = r"""
- name: Gather details of the roles for the 'yarn' service
cloudera.cluster.service_role_info:
cloudera.cluster.role_info:
host: "example.cloudera.host"
username: "jane_person"
password: "S&peR4Ec*re"
cluster: ExampleCluster
service: yarn

- name: Gather the details with additional healthcheck information for the roles in the 'ecs' service
cloudera.cluster.service_role_info:
cloudera.cluster.role_info:
host: "example.cloudera.host"
username: "jane_person"
password: "S&peR4Ec*re"
Expand All @@ -107,7 +107,7 @@
view: healthcheck

- name: Gather details of the 'NODEMANAGER' roles for the 'yarn' service
cloudera.cluster.service_role_info:
cloudera.cluster.role_info:
host: "example.cloudera.host"
username: "jane_person"
password: "S&peR4Ec*re"
Expand All @@ -116,7 +116,7 @@
type: NODEMANAGER

- name: Gather details of the roles for the 'yarn' service on a particular cluster host
cloudera.cluster.service_role_info:
cloudera.cluster.role_info:
host: "example.cloudera.host"
username: "jane_person"
password: "S&peR4Ec*re"
Expand Down Expand Up @@ -269,9 +269,9 @@
from cm_client.rest import ApiException


class ClusterServiceRoleInfo(ClouderaManagerModule):
class RoleInfo(ClouderaManagerModule):
def __init__(self, module):
super(ClusterServiceRoleInfo, self).__init__(module)
super(RoleInfo, self).__init__(module)

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

result = ClusterServiceRoleInfo(module)
result = RoleInfo(module)

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