Skip to content
Open
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
2 changes: 1 addition & 1 deletion bundles/admin/software.install.deployer_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The upstream repo ships a multi-stage Dockerfile :
| `REMOTE_PROJECT_DIR` | `/var/www/range42_deployer_ui` |
| `UI_PORT` | `3000` |
| `BACKEND_API_URL` | *(unset)* — when set, rendered into `public/config.json` so the SPA pre-registers this backend |
| `PROXMOX_NODE_NAME` | `pve` — paired with `BACKEND_API_URL` in `config.json` |
| `PROXMOX_NODE_NAME` | `proxmox_node` from the workspace vault, else `pve` — paired with `BACKEND_API_URL` in `config.json` |

## Call-site example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"type": "string",
"required": false,
"default_where": "bundle-inline",
"default": "pve",
"description": "Proxmox node the backend targets, paired with BACKEND_API_URL in config.json. Only consumed when BACKEND_API_URL is set."
"default": "proxmox_node from the workspace vault, else pve",
"description": "Proxmox node the backend targets, paired with BACKEND_API_URL in config.json. Defaults to the workspace vault's proxmox_node so a fresh lab seeds the node it actually deploys to; the literal \"pve\" is only the last-resort fallback. Only consumed when BACKEND_API_URL is set."
},
{
"name": "INSTALL_TAILSCALE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ params:
type: string
required: false
default_where: bundle-inline
default: "pve"
description: Proxmox node the backend targets, paired with BACKEND_API_URL in config.json. Only consumed when BACKEND_API_URL is set.
default: "proxmox_node from the workspace vault, else pve"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep prose out of the machine-readable default

When the catalog UI or another contract consumer materializes optional defaults, it will pass the literal value proxmox_node from the workspace vault, else pve as PROXMOX_NODE_NAME. The play then treats that supplied value as an explicit override at main.yml:149, so config.json receives the explanatory sentence instead of either the vault node or pve. The schema defines default as the effective default, so omit this field to let Ansible resolve it or encode a value the consumer can actually evaluate.

Useful? React with 👍 / 👎.

description: Proxmox node the backend targets, paired with BACKEND_API_URL in config.json. Defaults to the workspace vault's proxmox_node so a fresh lab seeds the node it actually deploys to; the literal "pve" is only the last-resort fallback. Only consumed when BACKEND_API_URL is set.

- name: INSTALL_TAILSCALE
type: bool
Expand Down
14 changes: 12 additions & 2 deletions bundles/admin/software.install.deployer_ui/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
# Unset = no config.json rendered, operator configures
# the backend by hand in the Settings modal.
# - PROXMOX_NODE_NAME : Proxmox node that backend targets, paired with
# BACKEND_API_URL in config.json (default "pve")
# BACKEND_API_URL in config.json. Defaults to
# `proxmox_node` from the workspace vault, so the
# node is right without the call-site restating it ;
# falls back to "pve" only when neither is set.
#
# Source provenance (this bundle deploys the controller's WORKING TREE) :
# The rsync below copies the controller's checkout as-is - branch, local
Expand Down Expand Up @@ -133,10 +136,17 @@
- name: install deployer-ui - sync source + .env + docker compose up
hosts: "{{ global_vm_ssh_name }}"
become: true
vars_files:
# For `proxmox_node` — the node this workspace actually targets. Without it
# config.json would seed the literal "pve" on every deployment and the
# operator would still have to fix the node by hand in Settings, which is
# the exact retyping this file exists to remove.
- "{{ lookup('env', 'RANGE42_ACTIVE_CONFIG_DIR') }}/secrets/default_vault.yml"
vars:
LOCAL_CODE_PATH_RESOLVED: "{{ LOCAL_CODE_PATH | default(lookup('env', 'RANGE42_GITDIR__ROOT_DIR') + '/range42-deployer-ui/', true) }}"
REMOTE_PROJECT_DIR_RESOLVED: "{{ REMOTE_PROJECT_DIR | default('/var/www/range42_deployer_ui') }}"
UI_PORT_RESOLVED: "{{ UI_PORT | default('3000') }}"
PROXMOX_NODE_NAME_RESOLVED: "{{ PROXMOX_NODE_NAME | default(proxmox_node | default('pve', true), true) }}"
tasks:
- name: Install rsync on remote (required for synchronize)
ansible.builtin.apt:
Expand Down Expand Up @@ -232,7 +242,7 @@
content: |
{
"defaultBackendUrl": {{ BACKEND_API_URL | to_json }},
"defaultNodeName": {{ PROXMOX_NODE_NAME | default('pve') | to_json }}
"defaultNodeName": {{ PROXMOX_NODE_NAME_RESOLVED | to_json }}
}
owner: root
group: root
Expand Down