@@ -125,18 +125,46 @@ jobs:
125
125
- name : Wait for SSH to be ready
126
126
run : |
127
127
echo ::group::wait_for_ssh
128
+ # Look for SSH keys created by litmus
129
+ if [ -f ./id_rsa ]; then
130
+ SSH_KEY="./id_rsa"
131
+ elif [ -f ./.vagrant/machines/*/virtualbox/private_key ]; then
132
+ SSH_KEY="./.vagrant/machines/*/virtualbox/private_key"
133
+ elif [ -f ./spec/fixtures/id_rsa ]; then
134
+ SSH_KEY="./spec/fixtures/id_rsa"
135
+ else
136
+ echo "No SSH key found, trying password authentication"
137
+ SSH_KEY=""
138
+ fi
139
+
140
+ echo "Using SSH key: $SSH_KEY"
141
+
128
142
# Wait for SSH to be available on all containers via Bolt
129
143
for i in {1..12}; do
130
144
echo "Attempt $i: Testing Bolt SSH connectivity..."
131
- if bundle exec bolt command run 'echo "Bolt SSH test successful"' \
132
- --inventoryfile ./inventory.yaml \
133
- --targets all \
134
- --connect-timeout 10 \
135
- --no-host-key-check \
136
- --transport ssh; then
145
+
146
+ # Build bolt command with appropriate auth
147
+ if [ -n "$SSH_KEY" ]; then
148
+ bolt_cmd="bundle exec bolt command run 'echo Bolt SSH test successful' \
149
+ --inventoryfile ./inventory.yaml \
150
+ --targets all \
151
+ --connect-timeout 30 \
152
+ --no-host-key-check \
153
+ --private-key $SSH_KEY \
154
+ --user root"
155
+ else
156
+ bolt_cmd="bundle exec bolt command run 'echo Bolt SSH test successful' \
157
+ --inventoryfile ./inventory.yaml \
158
+ --targets all \
159
+ --connect-timeout 30 \
160
+ --no-host-key-check"
161
+ fi
162
+
163
+ if eval $bolt_cmd; then
137
164
echo "All containers are accessible via Bolt SSH!"
138
165
break
139
166
fi
167
+
140
168
if [ $i -eq 12 ]; then
141
169
echo "Containers failed to become accessible after 12 attempts"
142
170
echo "Final inventory check:"
@@ -146,7 +174,7 @@ jobs:
146
174
echo "Waiting 10 seconds before retry..."
147
175
sleep 10
148
176
done
149
- echo ::endgroup::
177
+ echo ::endgroup::
150
178
- name : Install PE on test cluster
151
179
timeout-minutes : 120
152
180
run : |
0 commit comments