File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,6 +153,21 @@ $ $( openshift-install-wrapper --use \
153153 --domain aws.gmbros.net )
154154```
155155
156+ ### Pre-Loading options
157+ You can also pre-load options from a file by setting `INSTALLOPTS_ENV_FILE` before running the wrapper.
158+
159+ Example:
160+ ```
161+ $ cat /home/user/src//vsphere.env
162+ declare -A INSTALLOPTS
163+ INSTALLOPTS[ vsphere-vcenter] ="vcenter.example.local"
164+ INSTALLOPTS[ vsphere-vcenter-port] ="443"
165+ INSTALLOPTS[ vsphere-username] ="administrator@example.local "
166+ INSTALLOPTS[ vsphere-password] ="***** "
167+
168+ $ export INSTALLOPTS_ENV_FILE=/home/user/src/vsphere.env
169+ ```
170+
156171### Troubleshooting
157172- Use `--verbose` to get extra information during the execution, including the full output of `openshift-install`
158173- Review `$HOME/.local/ocp4/clusters/<cluster_name>/.openshift_install_wrapper.log` for useful output
Original file line number Diff line number Diff line change 11NAME = OpenShift Install Wrapper
2- VERSION = 1.6.0
2+ VERSION = 1.6.1
33TARGETDIR = ~/.local/ocp4
Original file line number Diff line number Diff line change 11# main function
22main () {
3+ # import INSTALLOPTS from env file (if present)
4+ load_installopts_env_file
5+
36 # parse arguments from commandline
47 while [[ ${1} = -?* ]]; do
58 key=" ${1} "
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ Options:
7979 --quiet - quiet mode (no output at all)
8080 --help|-h - shows this message
8181
82+ Environment:
83+ INSTALLOPTS_ENV_FILE=<path> - load INSTALLOPTS from a shell file
84+
8285Available customizations:
8386#__CUSTOM_SCRIPTS_NAMES__
8487EOF
Original file line number Diff line number Diff line change @@ -8,3 +8,23 @@ parse_args_as_variables() {
88 fi
99}
1010
11+ # load a file containing INSTALLOPTS definitions
12+ load_installopts_env_file () {
13+ [[ -n ${INSTALLOPTS_ENV_FILE} ]] || return 0
14+ [[ -f ${INSTALLOPTS_ENV_FILE} ]] || die " Error: INSTALLOPTS_ENV_FILE not found: ${INSTALLOPTS_ENV_FILE} "
15+ out " → Loading INSTALLOPTS from ${INSTALLOPTS_ENV_FILE} ..."
16+ # shellcheck disable=SC1090
17+ source " ${INSTALLOPTS_ENV_FILE} "
18+ local installopts_dump
19+ installopts_dump=" $( bash -c ' source "$1"; declare -p INSTALLOPTS 2>/dev/null' bash " ${INSTALLOPTS_ENV_FILE} " || true) "
20+ if [[ -n ${installopts_dump} ]]; then
21+ eval " ${installopts_dump/ declare -A/ declare -g -A} "
22+ out " → INSTALLOPTS loaded: ${# INSTALLOPTS[@]} entries."
23+ out " → INSTALLOPTS keys: ${! INSTALLOPTS[*]} "
24+ verbose " Loaded ${# INSTALLOPTS[@]} INSTALLOPTS entries from env file."
25+ verbose " INSTALLOPTS keys: ${! INSTALLOPTS[*]} "
26+ else
27+ out " → No INSTALLOPTS array found in env file."
28+ verbose " No INSTALLOPTS array found after sourcing env file."
29+ fi
30+ }
You can’t perform that action at this time.
0 commit comments