Skip to content

Commit 79ef8c6

Browse files
authored
Add MiNiFi Java Agent role (#313)
Signed-off-by: rsuplina <[email protected]>
1 parent 14459cd commit 79ef8c6

File tree

13 files changed

+1194
-0
lines changed

13 files changed

+1194
-0
lines changed

roles/minifi_agent_java/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# MiNiFi Java Agent
2+
3+
This role streamlines the deployment and configuration of Cloudera MiNiFi Java Agent on designated hosts.
4+
5+
The role will:
6+
- Retrieve the MiNiFi Java tarball from a user-defined or default source
7+
- Install MiNiFi Java into a configurable directory
8+
- Apply configuration using a Jinja2 template for `minifi.properties`
9+
- Configure C2 protocol for communication with EFM server
10+
- Support TLS/SSL configuration for secure communication
11+
- Install and start the MiNiFi Java agent service
12+
- Support authentication for protected download sources
13+
14+
## Requirements
15+
16+
- Network access from the target host to the URL specified in `minifi_java_tarball_url`
17+
- Access to EFM server for C2 communication (specified in `efm_host_url`)
18+
- For TLS configuration: Valid certificates and private keys on target host
19+
20+
## Variables
21+
22+
| Name | Purpose | Default (see `defaults/main.yml`) |
23+
|----------------------------------|--------------------------------------------------------------|---------------------------------------------|
24+
| `minifi_java_tarball_url` | Download link for the MiNiFi Java tarball | (default provided in role) |
25+
| `minifi_java_directory` | Installation directory for MiNiFi Java | `/opt/cloudera/cem/minifi-java` |
26+
| `minifi_java_properties_path` | Path to the MiNiFi Java properties file | `/opt/cloudera/cem/minifi-java/conf/minifi.properties` |
27+
| `minifi_java_agent_class_name` | Agent class name for MiNiFi Java agent | `minifi-agent-java` |
28+
| `efm_host_url` | URL for the EFM server for C2 communication | `http://localhost:10090` |
29+
| `minifi_java_repo_username` | Username for protected repositories (optional) | |
30+
| `minifi_java_repo_password` | Password for protected repositories (optional) | |
31+
| `minifi_tls_enabled` | Enable/disable TLS for MiNiFi Java agent | `false` |
32+
| `minifi_tls_client_certificate` | Path to client certificate file for TLS authentication | `/etc/pki/tls/certs/host.crt` |
33+
| `minifi_tls_client_private_key` | Path to client private key file for TLS authentication | `/etc/pki/tls/private/host.key` |
34+
| `minifi_tls_client_ca_certificate` | Path to CA certificate file for TLS authentication | `/etc/ipa/ca.crt` |
35+
| `minifi_java_service_path` | Path to the systemd service file for MiNiFi Java. | `/etc/systemd/system/minifi-java.service` |
36+
| `minifi_tls_keystore_path` | Path to the keystore file for TLS configuration. | |
37+
| `minifi_tls_keystore_type` | Type of the keystore (e.g., JKS, PKCS12). | |
38+
| `minifi_tls_keystore_password` | Password for the keystore file. | |
39+
| `minifi_tls_key_password` | Password for the private key in the keystore. | |
40+
| `minifi_tls_truststore_path` | Path to the truststore file for TLS configuration. | |
41+
| `minifi_tls_truststore_type` | Type of the truststore (e.g., JKS, PKCS12). | |
42+
| `minifi_tls_truststore_password` | Password for the truststore file. | |
43+
| `minifi_tls_ssl_protocol` | SSL protocol to use for TLS communication (e.g., TLSv1.2). | |
44+
45+
## Example usage
46+
47+
```yaml
48+
# Basic MiNiFi Java installation
49+
- hosts: minifi_nodes
50+
become: true
51+
tasks:
52+
- name: Install MiNiFi Java with basic configuration
53+
ansible.builtin.import_role:
54+
name: cloudera.exe.minifi_agent_java
55+
vars:
56+
minifi_java_repo_username: "repo_user"
57+
minifi_java_repo_password: "repo_pass"
58+
efm_host_url: "http://efm-server:10090"
59+
minifi_java_agent_class_name: "java-agent"
60+
# MiNiFi Java installation with TLS configuration
61+
- hosts: minifi_nodes
62+
become: true
63+
tasks:
64+
- name: Install MiNiFi Java with TLS enabled
65+
ansible.builtin.import_role:
66+
name: cloudera.exe.minifi_agent_java
67+
vars:
68+
efm_host_url: "https://efm-server:10090"
69+
minifi_tls_enabled: true
70+
minifi_tls_keystore_path: "/etc/pki/tls/keystore.jks"
71+
minifi_tls_keystore_password: "keystore_password"
72+
minifi_tls_truststore_path: "/etc/pki/tls/truststore.jks"
73+
minifi_tls_truststore_password: "truststore_password"
74+
minifi_tls_ssl_protocol: "TLSv1.2"
75+
```
76+
77+
## License
78+
79+
```
80+
Copyright 2025 Cloudera, Inc.
81+
82+
Licensed under the Apache License, Version 2.0 (the "License");
83+
you may not use this file except in compliance with the License.
84+
You may obtain a copy of the License at
85+
86+
https://www.apache.org/licenses/LICENSE-2.0
87+
88+
Unless required by applicable law or agreed to in writing, software
89+
distributed under the License is distributed on an "AS IS" BASIS,
90+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
91+
See the License for the specific language governing permissions and
92+
limitations under the License.
93+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
# Copyright 2025 Cloudera, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
minifi_java_directory: "/opt/cloudera/cem/minifi-java"
17+
minifi_java_tarball_url: "https://archive.cloudera.com/p/cem-agents-java/1.23.04.1000/ubuntu20/apt/tars/nifi-minifi-java/minifi-1.23.04.1000-b3-bin.tar.gz"
18+
minifi_java_properties_path: "/opt/cloudera/cem/minifi-java/conf/bootstrap.conf"
19+
minifi_java_service_path: "/etc/systemd/system/minifi-java.service"
20+
efm_host_url: "http://localhost:10090"
21+
minifi_java_agent_class_name: "minifi-agent-java"
22+
23+
# TLS Configuration
24+
minifi_tls_enabled: false
25+
# TLS settings (only used when minifi_tls_enabled is true)
26+
# minifi_tls_keystore_path: ""
27+
# minifi_tls_keystore_type: ""
28+
# minifi_tls_keystore_password: ""
29+
# minifi_tls_key_password: ""
30+
# minifi_tls_truststore_path: ""
31+
# minifi_tls_truststore_type: ""
32+
# minifi_tls_truststore_password: ""
33+
# minifi_tls_ssl_protocol: ""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# Copyright 2025 Cloudera, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
- name: Start minifi-java service
17+
ansible.builtin.systemd:
18+
name: minifi-java
19+
daemon_reload: true
20+
enabled: true
21+
state: started
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
# Copyright 2025 Cloudera, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
argument_specs:
17+
main:
18+
short_description: Install and configure Cloudera MiNiFi Java Agent
19+
description:
20+
- Downloads, installs, and configures Cloudera MiNiFi Java Agent on the target host.
21+
- Sets up the MiNiFi properties, and manages the systemd service.
22+
author: Cloudera Labs
23+
version_added: "3.3.0"
24+
options:
25+
minifi_java_tarball_url:
26+
description: URL to the MiNiFi Java tarball to download and install.
27+
type: str
28+
required: false
29+
default: "https://archive.cloudera.com/p/cem-agents/1.25.05-h2/ubuntu22/apt/tars/nifi-minifi-java/nifi-minifi-java-1.25.05-h2-b5-bin-linux.tar.gz"
30+
minifi_java_directory:
31+
description: Directory where MiNiFi Java will be installed.
32+
type: str
33+
required: false
34+
default: "/opt/cloudera/cem/minifi-java"
35+
minifi_java_properties_path:
36+
description: Path to the MiNiFi Java properties file.
37+
type: str
38+
required: false
39+
default: "/opt/cloudera/cem/minifi-java/conf/minifi.properties"
40+
minifi_java_agent_class_name:
41+
description: Agent class name for MiNiFi Java agent.
42+
type: str
43+
required: false
44+
default: "minifi-agent-java2"
45+
efm_api_url:
46+
description: URL for the Edge Flow Manager API.
47+
type: str
48+
required: false
49+
default: "http://localhost:10090/efm/api"
50+
minifi_java_repo_username:
51+
description: Username for protected Minifi repositories.
52+
type: str
53+
required: false
54+
minifi_java_repo_password:
55+
description: Password for protected Minifi repositories.
56+
type: str
57+
required: false
58+
efm_host_url:
59+
description: URL for the Edge Flow Manager server for C2 communication.
60+
type: str
61+
default: "http://localhost:10090"
62+
minifi_tls_enabled:
63+
description: Enable or disable TLS for MiNiFi Java agent.
64+
type: bool
65+
default: false
66+
minifi_tls_client_certificate:
67+
description: Path to the client certificate file for TLS authentication.
68+
type: str
69+
default: "/etc/pki/tls/certs/host.crt"
70+
minifi_tls_client_private_key:
71+
description: Path to the client private key file for TLS authentication.
72+
type: str
73+
default: "/etc/pki/tls/private/host.key"
74+
minifi_tls_client_ca_certificate:
75+
description: Path to the CA certificate file for TLS authentication.
76+
type: str
77+
default: "/etc/ipa/ca.crt"
78+
minifi_java_service_path:
79+
description: Path to the systemd service file for MiNiFi Java.
80+
type: str
81+
required: false
82+
default: "/etc/systemd/system/minifi-java.service"
83+
minifi_tls_keystore_path:
84+
description: Path to the keystore file for TLS configuration.
85+
type: str
86+
required: false
87+
minifi_tls_keystore_type:
88+
description: Type of the keystore (e.g., JKS, PKCS12).
89+
type: str
90+
required: false
91+
minifi_tls_keystore_password:
92+
description: Password for the keystore file.
93+
type: str
94+
required: false
95+
minifi_tls_key_password:
96+
description: Password for the private key in the keystore.
97+
type: str
98+
required: false
99+
minifi_tls_truststore_path:
100+
description: Path to the truststore file for TLS configuration.
101+
type: str
102+
required: false
103+
minifi_tls_truststore_type:
104+
description: Type of the truststore (e.g., JKS, PKCS12).
105+
type: str
106+
required: false
107+
minifi_tls_truststore_password:
108+
description: Password for the truststore file.
109+
type: str
110+
required: false
111+
minifi_tls_ssl_protocol:
112+
description: SSL protocol to use for TLS communication (e.g., TLSv1.2).
113+
type: str
114+
required: false
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Copyright 2025 Cloudera, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
- name: Converge
17+
hosts: all
18+
gather_facts: false
19+
become: false
20+
tasks:
21+
- name: Install and configure MiNiFi Java Agent
22+
ansible.builtin.import_role:
23+
name: cloudera.exe.minifi_agent_java

0 commit comments

Comments
 (0)