Skip to content

Commit 2849366

Browse files
authored
Deprecate legacy roles (#311)
* Deprecate legacy roles * Add deprecation module Signed-off-by: Webster Mudge <[email protected]>
1 parent 765e8b8 commit 2849366

File tree

82 files changed

+624
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+624
-0
lines changed

.ansible-lint-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ roles/cloudera_manager/autotls/tasks/patch_old_cm.yml command-instead-of-shell
2525
roles/cloudera_manager/autotls/tasks/patch_old_cm.yml fqcn[action-core]
2626
roles/cloudera_manager/autotls/tasks/patch_old_cm.yml jinja[spacing]
2727
roles/cloudera_manager/autotls/tasks/patch_old_cm.yml no-changed-when
28+
roles/cloudera_manager/common/defaults/main.yml var-naming[no-role-prefix]
2829
roles/cloudera_manager/common/handlers/main.yml fqcn[action-core]
2930
roles/cloudera_manager/common/handlers/main.yml name[casing]
3031
roles/cloudera_manager/config/defaults/main.yml var-naming[no-role-prefix]

plugins/modules/deprecation.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
4+
# Copyright 2025 Cloudera, Inc. All Rights Reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
DOCUMENTATION = r"""
19+
module: deprecation
20+
short_description: Display a deprecation warning
21+
description:
22+
- Displays a standard Ansible deprecation warning
23+
author:
24+
- "Webster Mudge (@wmudge)"
25+
version_added: "5.0.0"
26+
options:
27+
msg:
28+
description:
29+
- The deprecation warning message.
30+
type: str
31+
required: true
32+
version:
33+
description:
34+
- Version details for the warning message.
35+
type: str
36+
required: false
37+
"""
38+
39+
EXAMPLES = r"""
40+
- name: Display a deprecation warning
41+
cloudera.cluster.deprecation:
42+
msg: A custom warning
43+
44+
- name: Display the deprecation warning with version details
45+
cloudera.cluster.deprecation:
46+
msg: A custom warning with version info
47+
version: "5.0.0"
48+
"""
49+
50+
RETURN = r""""""
51+
52+
from ansible.module_utils.basic import AnsibleModule
53+
54+
55+
if __name__ == "__main__":
56+
module = AnsibleModule(
57+
argument_spec=dict(
58+
msg=dict(required="True"),
59+
version=dict(),
60+
),
61+
)
62+
63+
module.deprecate(module.params.get("msg"), module.params.get("version", None))
64+
module.exit_json()

roles/cloudera_manager/admin_password/check/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# limitations under the License.
1414

1515
---
16+
17+
- name: Deprecation warning
18+
run_once: true
19+
cloudera.cluster.deprecation:
20+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
21+
version: 6.0.0
22+
1623
- name: Wait for Cloudera Manager Port to be up
1724
delegate_to: "{{ groups.cloudera_manager[0] if 'cloudera_manager' in groups else 'localhost' }}"
1825
ansible.builtin.wait_for:

roles/cloudera_manager/admin_password/set/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# limitations under the License.
1414

1515
---
16+
17+
- name: Deprecation warning
18+
run_once: true
19+
cloudera.cluster.deprecation:
20+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
21+
version: 6.0.0
22+
1623
- name: Update the Cloudera Manager admin password
1724
cloudera.cluster.cm_api:
1825
endpoint: /users/admin

roles/cloudera_manager/agent/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# limitations under the License.
1414

1515
---
16+
17+
- name: Deprecation warning
18+
run_once: true
19+
cloudera.cluster.deprecation:
20+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
21+
version: 6.0.0
22+
1623
- name: Gather the package facts
1724
ansible.builtin.package_facts:
1825
manager: auto

roles/cloudera_manager/agent_config/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# limitations under the License.
1414

1515
---
16+
17+
- name: Deprecation warning
18+
run_once: true
19+
cloudera.cluster.deprecation:
20+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
21+
version: 6.0.0
22+
1623
- name: Set Cloudera Manager agent 'server_host' in config.ini
1724
lineinfile:
1825
dest: "{{ cloudera_manager_agent_config_file }}"

roles/cloudera_manager/api_client/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# limitations under the License.
1414

1515
---
16+
17+
- name: Deprecation warning
18+
run_once: true
19+
cloudera.cluster.deprecation:
20+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
21+
version: 6.0.0
22+
1623
- set_fact:
1724
cloudera_manager_url: "{{ cloudera_manager_protocol }}://{{ cloudera_manager_host }}:{{ cloudera_manager_port }}"
1825
when: cloudera_manager_url is not defined

roles/cloudera_manager/api_hosts/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# limitations under the License.
1414

1515
---
16+
17+
- name: Deprecation warning
18+
run_once: true
19+
cloudera.cluster.deprecation:
20+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
21+
version: 6.0.0
22+
1623
- name: Get the host identifiers and names from Cloudera Manager
1724
delegate_to: "{{ groups.cloudera_manager[0] if 'cloudera_manager' in groups else 'localhost' }}"
1825
cloudera.cluster.cm_api:

roles/cloudera_manager/autotls/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# limitations under the License.
1414

1515
---
16+
17+
- name: Deprecation warning
18+
run_once: true
19+
cloudera.cluster.deprecation:
20+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
21+
version: 6.0.0
22+
1623
- name: Check Cloudera Manager version
1724
cloudera.cluster.cm_api:
1825
endpoint: /cm/version

roles/cloudera_manager/cms_tls/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
---
2+
3+
- name: Deprecation warning
4+
run_once: true
5+
cloudera.cluster.deprecation:
6+
msg: "Role, {{ ansible_role_name }}, is no longer supported."
7+
version: 6.0.0
8+
29
- name: Setup TLS for Activity Monitor
310
cm_api:
411
method: PUT

0 commit comments

Comments
 (0)