Skip to content

Commit c53a76f

Browse files
output config value
1 parent 2611dae commit c53a76f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/workflows/test-backup-restore-migration.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ jobs:
138138
--inventoryfile spec/fixtures/litmus_inventory.yaml \
139139
--modulepath spec/fixtures/modules
140140
echo ::endgroup::
141+
- name: output useful info on config by running peadm::verify_config
142+
run: |
143+
bundle exec bolt plan run peadm::verify_config \
144+
--inventoryfile spec/fixtures/litmus_inventory.yaml
145+
primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml)
141146
- name: Wait as long as the file ${HOME}/pause file is present
142147
continue-on-error: true
143148
# if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plan peadm_spec::verify_config(
2+
Peadm::SingleTargetSpec $primary_host,
3+
) {
4+
$primary_target = peadm::get_targets($primary_host, 1)
5+
6+
out::message("Running peadm::status on primary host ${primary_host}")
7+
$result = run_plan('peadm::status', $primary_host, { 'format' => 'json' })
8+
9+
out::message($result)
10+
11+
if empty($result['failed']) {
12+
out::message('Cluster is healthy, continuing')
13+
} else {
14+
fail_plan('Cluster is not healthy, aborting')
15+
}
16+
17+
$result = run_task('peadm::get_peadm_config', $primary_host, '_catch_errors' => true).first.to_data()
18+
out::message("PE configuration: ${result}")
19+
$replica_host = $result['value']['params']['replica_host']
20+
out::message("Replica host: ${replica_host}")
21+
if $replica_host == undef or $replica_host == null {
22+
out::message('No replica was found in the PE configuration')
23+
} else {
24+
out::message("Replica added successfully: ${replica_host}")
25+
}
26+
}

0 commit comments

Comments
 (0)