Skip to content

Commit d997ef2

Browse files
(MAINT) attempt docker transport
1 parent 63a5042 commit d997ef2

File tree

1 file changed

+49
-46
lines changed

1 file changed

+49
-46
lines changed

.github/workflows/test-install-matrix.yaml

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,40 @@ jobs:
7777
echo ::group::list modules
7878
ls -l ./spec/fixtures/modules || true; echo
7979
echo ::endgroup::
80-
echo ::group::update every 'ssh:' tag in ./inventory.yaml file to add 'native-ssh: true' under install_test_cluster and indent correctly
81-
sed -i -e '/ssh:/a\ native-ssh: true' ./inventory.yaml || true; echo
82-
# Also add additional SSH options for container environments
83-
sed -i -e '/ssh:/a\ connect-timeout: 30' ./inventory.yaml || true; echo
84-
sed -i -e '/ssh:/a\ host-key-check: false' ./inventory.yaml || true; echo
85-
# Set root credentials if not already present
86-
sed -i -e '/ssh:/a\ user: root' ./inventory.yaml || true; echo
87-
sed -i -e '/ssh:/a\ password: root' ./inventory.yaml || true; echo
80+
echo ::group::show original inventory
81+
echo "=== Original inventory.yaml ==="
82+
cat ./inventory.yaml || echo "No inventory.yaml found"
8883
echo ::endgroup::
89-
echo ::group::fix inventory credentials
90-
# Backup original inventory
91-
cp ./inventory.yaml ./inventory.yaml.backup
84+
echo ::group::create docker transport inventory
85+
echo "=== Creating Docker transport inventory ==="
9286
93-
# Remove any existing SSH user/password entries and add correct ones
94-
sed -i '/user:/d' ./inventory.yaml
95-
sed -i '/password:/d' ./inventory.yaml
96-
sed -i '/host-key-check:/d' ./inventory.yaml
97-
sed -i '/connect-timeout:/d' ./inventory.yaml
98-
sed -i '/native-ssh:/d' ./inventory.yaml
87+
# Get container information
88+
container_info=$(docker ps --format "{{.Names}}" | grep -v NAMES)
9989
100-
# Add correct SSH configuration after each 'ssh:' line
101-
sed -i '/ssh:/a\ user: root' ./inventory.yaml
102-
sed -i '/ssh:/a\ password: root' ./inventory.yaml
103-
sed -i '/ssh:/a\ host-key-check: false' ./inventory.yaml
104-
sed -i '/ssh:/a\ connect-timeout: 30' ./inventory.yaml
105-
sed -i '/ssh:/a\ native-ssh: true' ./inventory.yaml
106-
107-
echo "=== Updated inventory.yaml ==="
108-
cat ./inventory.yaml
109-
echo ::endgroup::
110-
echo ::group::list contents of ./inventory.yaml
111-
ls -l ./inventory.yaml || true; echo
112-
cat ./inventory.yaml || true; echo
113-
echo ::endgroup::
114-
echo ::group::info:request
115-
cat request.json || true; echo
116-
echo ::endgroup::
90+
# Create new inventory with version 2 format and Docker transport
91+
cat > ./inventory.yaml << 'EOF'
92+
version: 2
93+
groups:
94+
- name: pe_nodes
95+
targets:
96+
EOF
97+
98+
# Add each container as a target
99+
for container_name in $container_info; do
100+
echo " - name: $container_name" >> ./inventory.yaml
101+
echo " uri: $container_name" >> ./inventory.yaml
102+
echo " config:" >> ./inventory.yaml
103+
echo " transport: docker" >> ./inventory.yaml
104+
echo " docker:" >> ./inventory.yaml
105+
echo " container-name: $container_name" >> ./inventory.yaml
106+
done
107+
108+
echo "=== New Docker transport inventory.yaml ==="
109+
cat ./inventory.yaml
110+
echo ::endgroup::
111+
echo ::group::info:request
112+
cat request.json || true; echo
113+
echo ::endgroup::
117114
- name: Debug container setup
118115
run: |
119116
echo ::group::debug_container_setup
@@ -186,18 +183,18 @@ jobs:
186183
docker exec $container passwd -S root || true
187184
done
188185
echo ::endgroup::
189-
- name: Wait for SSH to be ready
186+
- name: Wait for Docker connectivity to be ready
190187
run: |
191-
echo ::group::wait_for_ssh
192-
# Wait for SSH to be available on all containers via Bolt
188+
echo ::group::wait_for_docker
189+
# Wait for Docker connectivity to be available on all containers via Bolt
193190
for i in {1..12}; do
194-
echo "Attempt $i: Testing Bolt SSH connectivity..."
191+
echo "Attempt $i: Testing Bolt Docker connectivity..."
195192
196-
# Use inventory settings only (don't override with CLI args)
197-
if bundle exec bolt command run 'echo "Bolt SSH test successful"' \
193+
# Test Docker transport connectivity
194+
if bundle exec bolt command run 'echo "Bolt Docker test successful"' \
198195
--inventoryfile ./inventory.yaml \
199-
--targets all; then
200-
echo "All containers are accessible via Bolt SSH!"
196+
--targets pe_nodes; then
197+
echo "All containers are accessible via Bolt Docker transport!"
201198
break
202199
fi
203200
@@ -209,10 +206,10 @@ jobs:
209206
docker ps
210207
exit 1
211208
fi
212-
echo "Waiting 10 seconds before retry..."
213-
sleep 10
209+
echo "Waiting 5 seconds before retry..."
210+
sleep 5
214211
done
215-
echo ::endgroup::
212+
echo ::endgroup::
216213
- name: Check container SSH configuration
217214
run: |
218215
echo ::group::container_ssh_config
@@ -232,12 +229,18 @@ jobs:
232229
- name: Install PE on test cluster
233230
timeout-minutes: 120
234231
run: |
232+
echo "=== Starting PE installation with Docker transport ==="
233+
echo "Using inventory file:"
234+
cat ./inventory.yaml
235+
235236
bundle exec bolt plan run peadm_spec::install_test_cluster \
236237
--inventoryfile ./inventory.yaml \
237238
--modulepath spec/fixtures/modules \
238239
architecture=${{ matrix.architecture }} \
239240
version=${{ matrix.version }} \
240-
console_password=${{ secrets.CONSOLE_PASSWORD }}
241+
console_password=${{ secrets.CONSOLE_PASSWORD }} \
242+
--targets pe_nodes \
243+
--verbose
241244
- name: Tear down test cluster
242245
if: ${{ always() }}
243246
continue-on-error: true

0 commit comments

Comments
 (0)