Add native support for custom variable file #6

Open
opened 2023-01-13 11:12:11 +01:00 by pcaseiro · 0 comments
Owner

Bootstraper should be able to load any variable file provided.

Ex:

OpenNebula tools uses environement variables placed in /var/run/one-context/one_env, with this format

export ONEGATE_ENDPOINT="https://midgard.cadoles.com/gate"
export PXE_DHCPLEASEDURATION=""
export PXE_DHCPMODE="direct"
export PXE_DHCPRANGEEND="192.168.30.220"
export PXE_DHCPRANGESTART="192.168.30.200"
export PXE_DNSDOMAIN="ks.cadol.es"
export REPORT_READY="YES"
export SET_HOSTNAME="matchbox.cadol.es"

Provided the variable name matches the Templater variable "path" we should be able to replace de value provided in the configuration by the value present in the variable.

Ex: For this templater config:

"PXE": {
  "BootingMessage": "Booting from network the Cadoles way",
  "DHCPLeaseDuration": "12h",
  "DHCPMode": "proxy",
  "DHCPRangeEnd": "",
  "DHCPRangeStart": "",
  "DNSDomain": "cadoles.com",
  "DelayTime": "5",
  "GreetingMessage": "Cadoles PXE Boot Server",
  "ListenInterface": "eth0"
},

We should be able to replace the PXE.DNSDomain with the value of PXE_DNSDOMAIN

Bootstraper should be able to load any variable file provided. Ex: OpenNebula tools uses environement variables placed in `/var/run/one-context/one_env`, with this format ``` export ONEGATE_ENDPOINT="https://midgard.cadoles.com/gate" export PXE_DHCPLEASEDURATION="" export PXE_DHCPMODE="direct" export PXE_DHCPRANGEEND="192.168.30.220" export PXE_DHCPRANGESTART="192.168.30.200" export PXE_DNSDOMAIN="ks.cadol.es" export REPORT_READY="YES" export SET_HOSTNAME="matchbox.cadol.es" ``` Provided the variable name matches the Templater variable "path" we should be able to replace de value provided in the configuration by the value present in the variable. Ex: For this templater config: ``` "PXE": { "BootingMessage": "Booting from network the Cadoles way", "DHCPLeaseDuration": "12h", "DHCPMode": "proxy", "DHCPRangeEnd": "", "DHCPRangeStart": "", "DNSDomain": "cadoles.com", "DelayTime": "5", "GreetingMessage": "Cadoles PXE Boot Server", "ListenInterface": "eth0" }, ``` We should be able to replace the `PXE.DNSDomain` with the value of `PXE_DNSDOMAIN`
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: pcaseiro/templatefile#6
No description provided.