Skip to content

Commit 9ab4deb

Browse files
committed
add updating inventory file
1 parent 7d973da commit 9ab4deb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/test-failover.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,17 @@ jobs:
173173
done
174174
echo "${HOME}/pause absent, continuing workflow."
175175
176-
- name: 'Swap primary and replica nodes in inventory'
176+
- name: Set up yq
177+
uses: frenck/action-setup-yq@v1
178+
with:
179+
version: v4.30.5
180+
181+
- name: 'Update inventory'
177182
run: |
178-
sed -i.sedbak 's/role: primary$/role: failed/;s/primary/__tmp__/;s/spare-replica/__tmp2__/;s/replica/primary/;s/__tmp__/replica/;s/__tmp2__/replica/' \
183+
# Remove failed primary
184+
yq -i 'del(.groups[].targets[] | select(.vars.role == "primary"))' spec/fixtures/litmus_inventory.yaml
185+
# Swap primary and replica nodes
186+
sed -i.sedbak 's/primary/__tmp__/;s/spare-replica/__tmp2__/;s/replica/primary/;s/__tmp__/replica/;s/__tmp2__/replica/' \
179187
spec/fixtures/litmus_inventory.yaml
180188
181189
- name: 'Upgrade PE on test cluster'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ spec/docker/**/*.tar.gz
3636
spec/docker/**/*.asc
3737
spec/docker/**/files/puppet-enterprise*
3838
spec/docker/.task_cache.json
39-
.vscode/settings.json
39+
.vscode/settings.json

0 commit comments

Comments
 (0)