|
| 1 | +# cm_repo_local |
| 2 | + |
| 3 | +Set up a local HTTP-based package repository for Cloudera Manager. |
| 4 | + |
| 5 | +This role downloads a Cloudera Manager tarball package and sets up a local HTTP repository using Apache (httpd). This is useful for air-gapped environments or when you want to serve Cloudera Manager packages from a local web server. |
| 6 | + |
| 7 | +The role will: |
| 8 | +- Install and configure Apache HTTP Server (httpd) |
| 9 | +- Download the Cloudera Manager tarball package from a specified URL |
| 10 | +- Extract the tarball to a local repository directory with proper permissions (755) |
| 11 | +- Configure httpd to serve the repository on a custom port |
| 12 | +- Create a YUM repository configuration pointing to the local repository |
| 13 | +- Clean YUM metadata to ensure the new repository is recognized |
| 14 | + |
| 15 | +# Requirements |
| 16 | + |
| 17 | +- Internet access from the target host to the specified package repository URL. |
| 18 | +- Appropriate system permissions to manage package repositories (e.g., root access or sudo privileges). |
| 19 | + |
| 20 | +# Dependencies |
| 21 | + |
| 22 | +None. |
| 23 | + |
| 24 | +# Parameters |
| 25 | + |
| 26 | +| Variable | Type | Required | Default | Description | |
| 27 | +| --- | --- | --- | --- | --- | |
| 28 | +| `cloudera_manager_version` | `str` | `False` | `7.11.3` | Version of Cloudera Manager (used for reference/documentation) | |
| 29 | +| `cloudera_manager_tarball_url` | `str` | `True` | - | Full URL to the Cloudera Manager tarball package (e.g., `https://archive.cloudera.com/cm7/7.11.3/redhat8/yum/cloudera-manager-7.11.3-redhat8.tar.gz`) | |
| 30 | +| `cloudera_manager_repo_username` | `str` | `False` | - | Username for authenticated tarball downloads (if required) | |
| 31 | +| `cloudera_manager_repo_password` | `str` | `False` | - | Password for authenticated tarball downloads (if required) | |
| 32 | +| `cm_local_repo_base_path` | `str` | `False` | `/var/www/html/cloudera-repos` | Base directory where the repository will be extracted | |
| 33 | +| `cm_local_repo_httpd_port` | `int` | `False` | `3333` | Port on which httpd will serve the local repository | |
| 34 | +| `cm_local_repo_httpd_conf` | `str` | `False` | `/etc/httpd/conf/httpd.conf` | Path to the httpd configuration file | |
| 35 | +| `cm_local_repo_yum_conf` | `str` | `False` | `/etc/yum.repos.d/cloudera-manager.repo` | Path to the YUM repository configuration file | |
| 36 | + |
| 37 | +# Example Playbook |
| 38 | + |
| 39 | +```yaml |
| 40 | +- hosts: all |
| 41 | + tasks: |
| 42 | + - name: Set up local repository with authentication |
| 43 | + ansible.builtin.import_role: |
| 44 | + name: cloudera.exe.cm_repo_local |
| 45 | + vars: |
| 46 | + cloudera_manager_version: 7.11.3 |
| 47 | + cloudera_manager_tarball_url: "https://my-internal-repo.example/cm7/7.11.3/redhat8/yum/cloudera-manager-7.11.3.tar.gz" |
| 48 | + cloudera_manager_repo_username: "YOUR_UUID_HERE" # Replace with your actual UUID |
| 49 | + cloudera_manager_repo_password: "YOUR_PASSWORD_HERE" # Replace with your actual |
| 50 | + |
| 51 | + - name: Set up local repository with custom paths and port |
| 52 | + ansible.builtin.import_role: |
| 53 | + name: cloudera.exe.cm_repo_local |
| 54 | + vars: |
| 55 | + cloudera_manager_tarball_url: "https://my-internal-repo.example/cm7/7.11.3/redhat8/yum/cloudera-manager-7.11.3.tar.gz" |
| 56 | + cm_local_repo_base_path: "/opt/repos/cloudera" |
| 57 | + cm_local_repo_httpd_port: 8080 |
| 58 | + cloudera_manager_repo_username: "YOUR_UUID_HERE" # Replace with your actual UUID |
| 59 | + cloudera_manager_repo_password: "YOUR_PASSWORD_HERE" # Replace with your actual |
| 60 | +``` |
| 61 | +
|
| 62 | +# License |
| 63 | +
|
| 64 | +``` |
| 65 | +Copyright 2025 Cloudera, Inc. |
| 66 | + |
| 67 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 68 | +you may not use this file except in compliance with the License. |
| 69 | +You may obtain a copy of the License at |
| 70 | + |
| 71 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 72 | + |
| 73 | +Unless required by applicable law or agreed to in writing, software |
| 74 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 75 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 76 | +See the License for the specific language governing permissions and |
| 77 | +limitations under the License. |
| 78 | +``` |
0 commit comments