Skip to content

Commit 3d64c6b

Browse files
committed
Add CM agent provisioning role
Signed-off-by: Webster Mudge <[email protected]>
1 parent 765e8b8 commit 3d64c6b

File tree

12 files changed

+792
-0
lines changed

12 files changed

+792
-0
lines changed

roles/cm_agent/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# cm_agent
2+
3+
Install Cloudera Manager agent packages.
4+
5+
This role installs the Cloudera Manager agent packages on a target host and configures it to connect to a specified Cloudera Manager server. The management of the agent's version is handled implicitly through the configured package repository profile, ensuring compatibility with the Cloudera Manager server.
6+
7+
The role will:
8+
- Install the necessary Cloudera Manager agent packages.
9+
- Configure the agent to point to the `cloudera_manager_host`.
10+
- Enable and start the Cloudera Manager agent service.
11+
12+
# Requirements
13+
14+
- A valid Java JDK is required on the target host.
15+
- A valid Cloudera Manager package repository must be configured and accessible on the target host.
16+
17+
# Dependencies
18+
19+
None.
20+
21+
# Parameters
22+
23+
| Variable | Type | Required | Default | Description |
24+
| --- | --- | --- | --- | --- |
25+
| `cloudera_manager_host` | `str` | `True` | | Hostname of the Cloudera Manager server (e.g., `cm.example.com`). |
26+
27+
# Example Playbook
28+
29+
```yaml
30+
- hosts: cm_agents
31+
tasks:
32+
- name: Install Cloudera Manager agent on hosts
33+
ansible.builtin.import_role:
34+
name: cm_agent
35+
vars:
36+
cloudera_manager_host: cm.mycluster.internal
37+
```
38+
39+
# License
40+
41+
```
42+
Copyright 2025 Cloudera, Inc.
43+
44+
Licensed under the Apache License, Version 2.0 (the "License");
45+
you may not use this file except in compliance with the License.
46+
You may obtain a copy of the License at
47+
48+
https://www.apache.org/licenses/LICENSE-2.0
49+
50+
Unless required by applicable law or agreed to in writing, software
51+
distributed under the License is distributed on an "AS IS" BASIS,
52+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53+
See the License for the specific language governing permissions and
54+
limitations under the License.
55+
```

roles/cm_agent/defaults/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2025 Cloudera, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# cloudera_manager_host:

roles/cm_agent/handlers/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2025 Cloudera, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- name: Restart CM agent
16+
ansible.builtin.service:
17+
name: cloudera-scm-agent
18+
state: restarted
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2025 Cloudera, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
argument_specs:
16+
main:
17+
short_description: Install Cloudera Manager agent packages.
18+
description:
19+
- Install the Cloudera Manager agent packages and configure the C(server_host).
20+
- Version management is via the package repository profile.
21+
- Requires a valid JDK.
22+
- Requires a valid Cloudera Manager package repository.
23+
author: Cloudera Labs
24+
version_added: 5.0.0
25+
options:
26+
cloudera_manager_host:
27+
description: Cloudera Manager hostname
28+
required: true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Cloudera, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- name: Converge
16+
hosts: all
17+
gather_facts: true
18+
become: true
19+
tasks:
20+
- name: Install Cloudere Manager agent
21+
ansible.builtin.import_role:
22+
name: cm_agent

0 commit comments

Comments
 (0)