Skip to content

Commit d63edbe

Browse files
committed
Update README with parameter changes
Signed-off-by: Webster Mudge <wmudge@cloudera.com>
1 parent 587f27d commit d63edbe

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

roles/prereq_python/README.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# prereq_python
22

3-
Install Python
3+
Install Python and pip.
44

5-
This role ensures that the correct versions of Python are installed on a host to meet the requirements of specified Cloudera Manager and Cloudera Runtime versions. It also handles the installation and update of the `pip` package manager for Python 3. For environments that still require Python 2, the role provides a flag to control whether the installation is done via the system package manager or from source.
5+
This role ensures that the correct versions of Python are installed on a host to meet the requirements of specified Cloudera Manager and Cloudera Runtime versions. It also handles the installation and update of the `pip` package manager. For environments that still require Python 2, the role provides a flag to control whether the installation is done via the system package manager or from source.
66

77
To validate the required Python version for a given Cloudera Manager and Runtime, the [Cloudera on premise documentation](https://docs.cloudera.com/cdp-private-cloud-base/latest/installation/topics/cdpdc-cm-install-python-3.8.html) and the support matrix variables defined in the `cloudera.exe.prereq_supported` role are used.
88

99
The role will:
1010
- Determine the required Python versions based on `cloudera_manager_version` and `cloudera_runtime_version`.
11-
- Install the necessary Python 3 packages if a supported version is not already present.
12-
- Install or update the `pip` package for Python 3.
13-
- If Python 2 is required, install it either via the system's package manager (`python2_package_install: true`) or from source (`python2_package_install: false`).
14-
- Ensure that the installed Python versions and `pip` are properly configured and accessible.
11+
- Install the necessary Python packages if a supported version is not already present and installations and upgrades are enabled.
12+
- Install or update the `pip` package for Python.
13+
- Ensure that the installed Python versions and `pip` are properly configured and updated.
1514

1615
# Requirements
1716

1817
- Root or `sudo` privileges are required on the target host to install system packages.
1918
- Network access to package repositories (for system packages) and PyPI (for pip).
20-
- If installing Python 2 from source, the host will require build tools (e.g., `gcc`, `make`, development headers).
2119

2220
# Dependencies
2321

@@ -27,36 +25,34 @@ None.
2725

2826
| Variable | Type | Required | Default | Description |
2927
| --- | --- | --- | --- | --- |
30-
| `cloudera_manager_version` | `str` | `False` | `7.11.3` | The version of Cloudera Manager to use for determining Python version requirements. |
31-
| `cloudera_runtime_version` | `str` | `False` | `7.1.9` | The version of Cloudera Runtime to use for determining Python version requirements. |
32-
| `python3_package` | `str` | `False` | - | An optional name of the Python 3 package to install. This is only used when a supported version of Python 3 is not found. If not specified, the role will use OS-specific default package names. |
33-
| `python3_pip_package` | `str` | `False` | `python-pip` | The name of the Python 3 Pip package to be installed or updated. |
34-
| `python2_package_install` | `bool` | `False` | `true` | Flag to specify if Python 2 should be installed via the system package manager. If `false`, the role will attempt to install Python 2 from source. |
28+
| `cloudera_manager_version` | `str` | `True` | | The version of Cloudera Manager to use for determining Python version requirements. |
29+
| `cloudera_runtime_version` | `str` | `True` | | The version of Cloudera Runtime to use for determining Python version requirements. |
30+
| `python_packages` | `list[str]` | `False` | - | Optional names of the Python packages to install. This is only used when a supported version of Python is not found. If not specified, the role will use OS-specific default package names. |
31+
| `python_pip_packages` | `list[str]` | `False` | `[ python-pip ]` | The names of the Python pip packages to be installed or updated. |
32+
| `prereq_python_upgrade` | `bool` | `False` | `true` | Flag to enable Python installation or upgrade if a supported version is not present. If `true`, the latest supported version or the `python_packages` will be installed. |
3533

3634
# Example Playbook
3735

3836
```yaml
3937
- hosts: all
4038
tasks:
4139
- name: Install Python for Cloudera Manager 7.11.3 / Cloudera Runtime 7.1.9
42-
ansible.builtin.import_role:
43-
name: cloudera.exe.prereq_python
44-
# All variables will use their defaults, installing Python 3 with pip and Python 2 via package manager.
45-
46-
- name: Install Python for a different version of Cloudera Runtime
4740
ansible.builtin.import_role:
4841
name: cloudera.exe.prereq_python
4942
vars:
50-
cloudera_runtime_version: "7.1.8"
51-
# The role will adjust Python version requirements accordingly.
43+
cloudera_manager_version: 7.11.3
44+
cloudera_runtime_version: 7.1.9
5245

53-
- name: Install Python with custom package names and install Python 2 from source
46+
- name: Install Python with custom package names
5447
ansible.builtin.import_role:
5548
name: cloudera.exe.prereq_python
5649
vars:
57-
python3_package: "python39" # Example custom package name for Python 3.9
58-
python3_pip_package: "python3-pip"
59-
python2_package_install: false # Install Python 2 from source
50+
cloudera_manager_version: 7.11.3
51+
cloudera_runtime_version: 7.1.9
52+
python_packages:
53+
- python39 # Example custom package name for Python 3.9
54+
python_pip_package:
55+
- python3-pip
6056
```
6157
6258
# License

0 commit comments

Comments
 (0)