Skip to content

Commit 114df4a

Browse files
fonta-rhclaude
andcommitted
feat: move common.sh to deploy/, add baremetal config sync and 0-byte guard
Move common.sh from deploy/aws-hypervisor/scripts/ to deploy/ so all deploy paths (AWS and baremetal) can source it without reaching into aws-hypervisor internals. Add config_baremetal_fencing.sh to the sync manifest and have baremetal-adopt generate it into config/. Skip syncing 0-byte source files to prevent accidental credential blanking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f152d1e commit 114df4a

25 files changed

Lines changed: 50 additions & 35 deletions

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ User configuration files are created in `config/` at the repository root (templa
136136
- `config/instance.env`: AWS hypervisor settings (copy from `config/instance.env.template`)
137137
- `config/pull-secret.json`: OpenShift pull secret, fanned out to both dev-scripts and kcli role locations
138138
- `config/config_arbiter.sh`, `config/config_fencing.sh`, `config/config_sno.sh`: dev-scripts topology configs (copy from the `config/config_*_example.sh` files)
139+
- `config/config_baremetal_fencing.sh`: baremetal fencing topology config (generated by `make baremetal-adopt`)
139140
- `config/kcli.yml`: kcli variable overrides (copy from `config/kcli.yml.template`)
140141
- `config/assisted.yml`: assisted installer variables (copy from `config/assisted.yml.template`)
141142
- `config/init-host.yml.local`: external-host RHSM overrides (copy from `deploy/openshift-clusters/vars/init-host.yml`)
@@ -145,6 +146,7 @@ User configuration files are created in `config/` at the repository root (templa
145146
- `roles/dev-scripts/install-dev/files/config_arbiter.sh`: Arbiter topology config
146147
- `roles/dev-scripts/install-dev/files/config_fencing.sh`: Fencing topology config
147148
- `roles/dev-scripts/install-dev/files/config_sno.sh`: Single Node OpenShift config
149+
- `roles/dev-scripts/install-dev/files/config_baremetal_fencing.sh`: Baremetal fencing topology config
148150
- `roles/dev-scripts/install-dev/files/pull-secret.json`: OpenShift pull secret
149151

150152
#### Kcli Method (canonical locations)

config/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ prevents your real config files (including the pull secret) from ever being comm
1818
| `config_arbiter.sh` | dev-scripts arbiter topology | `deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_arbiter.sh` | `cp config/config_arbiter_example.sh config/config_arbiter.sh` |
1919
| `config_fencing.sh` | dev-scripts fencing topology | `deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_fencing.sh` | `cp config/config_fencing_example.sh config/config_fencing.sh` |
2020
| `config_sno.sh` | dev-scripts SNO topology | `deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_sno.sh` | `cp config/config_sno_example.sh config/config_sno.sh` |
21+
| `config_baremetal_fencing.sh` | dev-scripts baremetal fencing topology | `deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_baremetal_fencing.sh` | Generated by `make baremetal-adopt`, or copy from canonical location |
2122
| `kcli.yml` | kcli deployment (optional overrides) | `deploy/openshift-clusters/vars/kcli.yml` | `cp config/kcli.yml.template config/kcli.yml` |
2223
| `assisted.yml` | assisted installer spoke deployment | `deploy/openshift-clusters/vars/assisted.yml` | `cp config/assisted.yml.template config/assisted.yml` |
2324
| `init-host.yml.local` | external host initialization (optional RHSM overrides) | `deploy/openshift-clusters/vars/init-host.yml.local` | `cp deploy/openshift-clusters/vars/init-host.yml config/init-host.yml.local` |

deploy/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ inventory:
6262
@./aws-hypervisor/scripts/inventory.sh
6363

6464
sync-config:
65-
@bash -c 'source ./aws-hypervisor/scripts/common.sh; if [ "$${CONFIG_SYNCED_COUNT:-0}" -eq 0 ]; then echo "Config files: everything up to date."; fi'
65+
@bash -c 'source ./common.sh; if [ "$${CONFIG_SYNCED_COUNT:-0}" -eq 0 ]; then echo "Config files: everything up to date."; fi'
6666

6767
fencing-ipi:
6868
@./openshift-clusters/scripts/deploy-cluster.sh --topology fencing --method ipi

deploy/aws-hypervisor/scripts/create.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SCRIPT_DIR=$(dirname "$0")
44
# shellcheck source=/dev/null
5-
source "${SCRIPT_DIR}/common.sh"
5+
source "${SCRIPT_DIR}/../../common.sh"
66

77
set -o nounset
88
set -o errexit

deploy/aws-hypervisor/scripts/destroy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SCRIPT_DIR=$(dirname "$0")
44
# shellcheck source=/dev/null
5-
source "${SCRIPT_DIR}/common.sh"
5+
source "${SCRIPT_DIR}/../../common.sh"
66

77
set -o nounset
88
set -o errexit

deploy/aws-hypervisor/scripts/force-stop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SCRIPT_DIR=$(dirname "$0")
44
# shellcheck source=/dev/null
5-
source "${SCRIPT_DIR}/common.sh"
5+
source "${SCRIPT_DIR}/../../common.sh"
66

77
set -o nounset
88
set -o errexit

deploy/aws-hypervisor/scripts/init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
SCRIPT_DIR=$(dirname "$0")
33
# shellcheck source=/dev/null
4-
source "${SCRIPT_DIR}/common.sh"
4+
source "${SCRIPT_DIR}/../../common.sh"
55

66
node_dir="$(get_node_dir)"
77
instance_ip="$(cat "${node_dir}/ssh_user")@$(cat "${node_dir}/public_address")"

deploy/aws-hypervisor/scripts/inventory.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SCRIPT_DIR=$(dirname "$0")
44
# shellcheck source=/dev/null
5-
source "${SCRIPT_DIR}/common.sh"
5+
source "${SCRIPT_DIR}/../../common.sh"
66

77
set -o nounset
88
set -o errexit

deploy/aws-hypervisor/scripts/print_instance_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
SCRIPT_DIR=$(dirname "$0")
33
# shellcheck source=/dev/null
4-
source "${SCRIPT_DIR}/common.sh"
4+
source "${SCRIPT_DIR}/../../common.sh"
55

66
node_dir="$(get_node_dir)"
77
echo "Stack: $(cat "${node_dir}/rhel_host_stack_name")"

deploy/aws-hypervisor/scripts/ssh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
SCRIPT_DIR=$(dirname "$0")
33
# shellcheck source=/dev/null
4-
source "${SCRIPT_DIR}/common.sh"
4+
source "${SCRIPT_DIR}/../../common.sh"
55

66
node_dir="$(get_node_dir)"
77
instance_ip="$(cat "${node_dir}/ssh_user")@$(cat "${node_dir}/public_address")"

0 commit comments

Comments
 (0)