diff --git a/docs/itential_gateway_guide.md b/docs/itential_gateway_guide.md index ed0600fd..38413377 100644 --- a/docs/itential_gateway_guide.md +++ b/docs/itential_gateway_guide.md @@ -48,6 +48,7 @@ The following table lists the default variables located in `roles/gateway/defaul | `gateway_enable_grpc` | Boolean | Flag to enable GRPC requests. | `true` | | `gateway_enable_git` | Boolean | Flag to enable Git integration. | `true` | | `gateway_install_dir` | String | The base directory where to install the IAG files. | `/opt/automation-gateway` | +| `gateway_build_temp_dir_path` | String | Optional directory for the build/staging working directory. Undefined by default, in which case Ansible's own temp-directory resolution is used unchanged. Set this (e.g. to `/var/tmp`) only if `/tmp` is mounted `noexec` on the target host. | Undefined | | `gateway_ansible_collections_path` | String | The location of IAG Ansible collections. | `{{ gateway_install_dir }}/ansible/collections` | | `gateway_data_dir` | String | The IAG data directory. | `/var/lib/automation-gateway` | | `gateway_log_dir` | String | The IAG log directory. | `/var/log/automation-gateway` | diff --git a/docs/redis_guide.md b/docs/redis_guide.md index 2ed9c8fd..54dc6b5b 100644 --- a/docs/redis_guide.md +++ b/docs/redis_guide.md @@ -227,6 +227,7 @@ The following tables lists the default variables located in `roles/redis/default | `redis_source_url` | String | The Redis source URL | Varies depending on OS and Platform release | | `redis_remi_repo_url` | String | The URL of the Remi repo RPM. Note: this is only used when the `redis_install_from_source` is set to `false` and the Remi packages are being installed. | `http://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm` | | `redis_epel_repo_url` | String | The URL of the EPEL repo RPM. Note: this is only used when the `redis_install_from_source` is set to `false` and the Remi packages are being installed. | `https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm` | +| `redis_build_temp_dir_path` | String | Optional directory for the source-build working directory. Undefined by default, in which case Ansible's own temp-directory resolution is used unchanged. Set this (e.g. to `/var/tmp`) only if `/tmp` is mounted `noexec` on the target host, which breaks the source build. | Undefined | ### Redis Variables diff --git a/roles/gateway/CLAUDE.md b/roles/gateway/CLAUDE.md index 8a0da52a..978e2996 100644 --- a/roles/gateway/CLAUDE.md +++ b/roles/gateway/CLAUDE.md @@ -44,6 +44,7 @@ Installs and configures Itential Automation Gateway (IAG). Handles Python virtua | Variable | Default | Purpose | |----------|---------|---------| | `gateway_install_dir` | `/opt/automation-gateway` | IAG installation root | +| `gateway_build_temp_dir_path` | (undefined) | Optional `path` for the build/staging working directory's `ansible.builtin.tempfile` task. Undefined by default so the module falls back to its own directory resolution; set explicitly (e.g. `/var/tmp`) on hosts where `/tmp` is mounted `noexec` | | `gateway_data_dir` | `/var/lib/automation-gateway` | IAG data directory | | `gateway_log_dir` | `/var/log/automation-gateway` | IAG log directory | | `gateway_properties_location` | `/etc/automation-gateway` | Properties file directory | diff --git a/roles/gateway/tasks/main.yml b/roles/gateway/tasks/main.yml index 45b534fb..2c6e491f 100644 --- a/roles/gateway/tasks/main.yml +++ b/roles/gateway/tasks/main.yml @@ -27,8 +27,15 @@ when: gateway_invalid_release is defined - name: Create temporary working directory + # gateway_build_temp_dir_path is intentionally undefined by default (rather than + # defaulting to a literal "/tmp") so that when it is not set, the path argument is + # omitted entirely and this module falls back to its own normal directory + # resolution (TMPDIR/TEMP/TMP env vars, then /tmp, /var/tmp, /usr/tmp) - the same + # behavior as before this variable existed. Set it explicitly (e.g. to /var/tmp) + # only on hosts where /tmp is mounted noexec. ansible.builtin.tempfile: state: directory + path: "{{ gateway_build_temp_dir_path | default(omit) }}" register: gateway_workingdir - name: Install Gateway dependency packages diff --git a/roles/redis/CLAUDE.md b/roles/redis/CLAUDE.md index 594ae156..02400d40 100644 --- a/roles/redis/CLAUDE.md +++ b/roles/redis/CLAUDE.md @@ -84,6 +84,7 @@ Installs and configures Redis and Redis Sentinel for use with Itential Platform. | `redis_security_packages` | `policycoreutils-python-utils` | SELinux management package | | `redis_remi_repo_url` | Remi enterprise URL | Used when installing from Remi repo | | `redis_epel_repo_url` | Fedora EPEL URL | Used when installing EPEL for Remi | +| `redis_build_temp_dir_path` | (undefined) | Optional `path` for the source-build working directory's `ansible.builtin.tempfile` task. Undefined by default so the module falls back to its own directory resolution; set explicitly (e.g. `/var/tmp`) on hosts where `/tmp` is mounted `noexec`, which breaks the `make`/`make install` steps | ### pki.yml defaults (TLS paths) diff --git a/roles/redis/tasks/install-from-source.yml b/roles/redis/tasks/install-from-source.yml index 93f42eb2..6055e023 100644 --- a/roles/redis/tasks/install-from-source.yml +++ b/roles/redis/tasks/install-from-source.yml @@ -28,8 +28,16 @@ when: (not redis_installed.stat.exists) or (requires_rebuild | default(false)) block: - name: Create temporary working directory + # redis_build_temp_dir_path is intentionally undefined by default (rather than + # defaulting to a literal "/tmp") so that when it is not set, the path argument is + # omitted entirely and this module falls back to its own normal directory + # resolution (TMPDIR/TEMP/TMP env vars, then /tmp, /var/tmp, /usr/tmp) - the same + # behavior as before this variable existed. Set it explicitly (e.g. to /var/tmp) + # only on hosts where /tmp is mounted noexec, which breaks the "make"/"make + # install" steps below. ansible.builtin.tempfile: state: directory + path: "{{ redis_build_temp_dir_path | default(omit) }}" register: redis_build_temp_dir - name: Online install