Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions docs/itential_platform_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,31 @@ These variables will effect how the installation occurs.
| `repository_username` | `platform` | String | The username for authentication of the repository. | N/A |
| `repository_password` | `platform` | String | The password for authentication of the repository. | N/A |
| `repository_api_key` | `platform` | String | The API for authentication of the repository. Can be used instead of username/password for authentication.| N/A |
| `platform_nodejs_package` | `platform` | String | The Node.js package or module stream to install. The default depends on the OS major version, see below. | `@nodejs:22/common` (RHEL, Rocky, Alma 8), `@nodejs:22` (RHEL, Rocky, Alma 9), `nodejs22` (Amazon Linux 2023) |
| `platform_nodejs_package` | `platform` | String | The Node.js package or module stream to install. The default depends on the Itential Platform version and the OS major version, see below. | Node 22 for Itential Platform 6.6.0 and later, Node 20 for earlier releases |

If `platform_packages` contains URLs, either `repository_api_key` or `repository_username` and
`repository_password` must be defined.

Itential Platform 6.6 and later requires Node 22. For Itential Platform 6.5.x and earlier, set
`platform_nodejs_package` in the inventory.
Itential Platform 6.6.0 and later requires Node 22. Earlier releases require Node 20. The deployer
reads the Itential Platform version from the `itential-platform-X.Y.Z` RPM in `platform_packages`
(or, for offline installs, from the `itential-platform` RPM in the `platform` directory under the
offline RPM directory on the control node) and selects the matching Node.js package. The install
fails if the version cannot be determined or if Node 20 is required on an OS that does not provide
it. Node 20 is not available on RHEL/Rocky/Alma 10.

| OS | Node 20 value | Node 22 value (default) |
| :-- | :------------ | :---------------------- |
| OS | Node 20 value | Node 22 value |
| :-- | :------------ | :------------ |
| RHEL/Rocky/Alma 8 | `@nodejs:20/common` | `@nodejs:22/common` |
| RHEL/Rocky/Alma 9 | `@nodejs:20` | `@nodejs:22` |
| RHEL/Rocky/Alma 10 | N/A | `nodejs22` |
| Amazon Linux 2023 | `nodejs20` | `nodejs22` |

To use a different Node.js package, set `platform_nodejs_package` in the inventory. When it is set,
the version lookup is skipped.

```yaml
platform_release: 6
platform_nodejs_package: "@nodejs:20" # Itential Platform 6.5.x on RHEL/Rocky 9
platform_nodejs_package: "@nodejs:20" # Override the default Node.js package
```

#### Authentication Variables
Expand Down
7 changes: 3 additions & 4 deletions roles/platform/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Installs and configures Itential Platform (IAP). Handles OS user/directory setup
- Validates Vault variables when `platform_configure_vault: true`
- Validates PKI source directories when copy-certs flags are enabled
- Loads `vars/platform-release-<N>.yml` and sets release-specific defaults for NodeJS/Python when not overridden in inventory
- When `platform_nodejs_package` is not set, derives `platform_version` from the `itential-platform-X.Y.Z` RPM (`platform_packages` online, or `{{ platform_offline_control_node_rpms_dir }}/platform` on the control node offline), then picks Node 22 for `>= 6.6.0` and Node 20 otherwise. Fails if no single version is found or Node 20 is required on EL10

## Key Variables

Expand Down Expand Up @@ -264,14 +265,12 @@ Both groups receive the same role. The `platform_server_id` defaults to `invento

| Variable | RHEL 8 | RHEL 9 / AL2023 |
|----------|--------|-----------------|
| `platform_nodejs_package` | `@nodejs:22/common` | `@nodejs:22` / `nodejs22` |
| `platform_nodejs_package` | `@nodejs:22/common` (Node 22) / `@nodejs:20/common` (Node 20) | `@nodejs:22` / `@nodejs:20` (RHEL 9), `nodejs22` / `nodejs20` (AL2023), `nodejs22` only (RHEL 10) |
| `platform_python_version` | `3.11` | `3.11` |
| `platform_python_packages` | `python3.11`, `python3.11-pip` | same |
| `platform_python_app_dependencies` | `jinja2==3.1.2`, `markupsafe==2.1.4`, `textfsm==1.1.3` | same |

Itential Platform 6.6 and later requires Node 22. For Itential Platform 6.5.x and earlier, override
`platform_nodejs_package` in the inventory with the Node 20 value: `@nodejs:20/common` (RHEL 8),
`@nodejs:20` (RHEL 9), `nodejs20` (Amazon Linux 2023).
Itential Platform 6.6.0 and later requires Node 22, earlier releases require Node 20 (`platform_nodejs_22_min_platform_version`). `platform_nodejs_package_default` is keyed by Node major version, then OS major version. Setting `platform_nodejs_package` in the inventory overrides the default and skips the version lookup.

Hardware specs for `verify` playbook (`platform_hw_specs`):
- dev: 8 CPU, 32 GB RAM, 250 GB disk
Expand Down
60 changes: 57 additions & 3 deletions roles/platform/tasks/validate-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,64 @@

- name: Set platform_nodejs_package to the default value
when not defined in inventory
ansible.builtin.set_fact:
platform_nodejs_package:
"{{ platform_nodejs_package_default[ansible_distribution_major_version] }}"
when: platform_nodejs_package is not defined
block:
- name: Find the Itential Platform RPM on the control node
ansible.builtin.find:
paths: "{{ platform_offline_control_node_rpms_dir }}/platform"
patterns: "itential-platform-*.rpm"
register: platform_offline_rpm_find
delegate_to: localhost
become: false
when: offline_install_enabled | bool

- name: Determine the Itential Platform version from the Itential Platform RPM
ansible.builtin.set_fact:
platform_rpm_versions: >-
{{ ((platform_offline_rpm_find.files | map(attribute='path')
if offline_install_enabled | bool else platform_packages)
| map('basename')
| select('match', 'itential-platform-[0-9]')
| map('regex_search', '[0-9]+[.][0-9]+[.][0-9]+')
| select | unique | list) }}

- name: Validate a single Itential Platform version was found
ansible.builtin.assert:
that: platform_rpm_versions | length == 1
fail_msg: >-
Unable to determine the Itential Platform version from the
itential-platform RPM. Found versions: {{ platform_rpm_versions }}.
Exactly one itential-platform-X.Y.Z RPM is required in
{{ (platform_offline_control_node_rpms_dir + '/platform')
if offline_install_enabled | bool else 'platform_packages' }}.
Alternatively, define platform_nodejs_package.

- name: Set platform_version from the Itential Platform RPM
ansible.builtin.set_fact:
platform_version: "{{ platform_rpm_versions | first }}"

- name: Set the Node.js major version required by the Itential Platform version
ansible.builtin.set_fact:
platform_nodejs_major_version: >-
{{ '22' if platform_version is version(
platform_nodejs_22_min_platform_version, '>=')
else '20' }}

- name: Validate Node.js is available for the OS
ansible.builtin.assert:
that: >-
ansible_distribution_major_version in
platform_nodejs_package_default[platform_nodejs_major_version]
fail_msg: >-
Itential Platform {{ platform_version }} requires
Node {{ platform_nodejs_major_version }}, which is not available on
{{ ansible_distribution }} {{ ansible_distribution_major_version }}.

- name: Set platform_nodejs_package from the Node.js major version and OS
ansible.builtin.set_fact:
platform_nodejs_package: >-
{{ platform_nodejs_package_default[platform_nodejs_major_version]
[ansible_distribution_major_version] }}

- name: Set platform_python_version to the default value
when not defined in inventory
Expand Down
17 changes: 13 additions & 4 deletions roles/platform/vars/platform-release-6.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# Copyright (c) 2024, Itential, Inc
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---
# Itential Platform >= this version requires Node 22, earlier releases require Node 20.
platform_nodejs_22_min_platform_version: "6.6.0"

# Node.js package by Node major version, then OS major version. Node 20 is not available on EL10.
platform_nodejs_package_default:
"8": "@nodejs:22/common"
"9": "@nodejs:22"
"10": "nodejs22"
"2023": "nodejs22"
"22":
"8": "@nodejs:22/common"
"9": "@nodejs:22"
"10": "nodejs22"
"2023": "nodejs22"
"20":
"8": "@nodejs:20/common"
"9": "@nodejs:20"
"2023": "nodejs20"

platform_python_version_default:
"8": 3.11
Expand Down