Skip to content

Commit 1a52649

Browse files
mcka1nreidmv
authored andcommitted
switches to the architecture logic for collection
1 parent f106dd1 commit 1a52649

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

.github/workflows/test-upgrade.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ jobs:
175175
bundle exec bolt plan run peadm_spec::upgrade_test_cluster \
176176
--inventoryfile spec/fixtures/litmus_inventory.yaml \
177177
--modulepath spec/fixtures/modules \
178+
architecture=${{ matrix.architecture }} \
178179
download_mode=${{ matrix.download_mode }} \
179180
version=${{ matrix.version_to_upgrade }}
180181
Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
plan peadm_spec::upgrade_test_cluster(
2+
$architecture,
23
$version,
34
$download_mode
45
){
@@ -11,17 +12,44 @@
1112
$target.set_var('certname', $fqdn.first['stdout'].chomp)
1213
}
1314

14-
$primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }
15-
$replica_host = $t.filter |$n| { $n.vars['role'] == 'replica' }
16-
$replica_postgresql_host = $t.filter |$n| { $n.vars['role'] == 'replica-pdb-postgresql' }
17-
18-
$params = {
19-
primary_host => $primary_host,
20-
replica_host => $replica_host,
21-
replica_postgresql_host => $replica_postgresql_host ? { [] => undef, default => $replica_postgresql_host },
22-
download_mode => 'direct',
23-
version => $version,
15+
$common_params = {
16+
download_mode => $download_mode,
17+
version => $version,
2418
}
2519

20+
$arch_params =
21+
case $architecture {
22+
'standard': {{
23+
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
24+
}}
25+
'standard-with-dr': {{
26+
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
27+
replica_host => $t.filter |$n| { $n.vars['role'] == 'replica' },
28+
}}
29+
'large': {{
30+
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
31+
compiler_hosts => $t.filter |$n| { $n.vars['role'] == 'compiler' },
32+
}}
33+
'large-with-dr': {{
34+
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
35+
replica_host => $t.filter |$n| { $n.vars['role'] == 'replica' },
36+
compiler_hosts => $t.filter |$n| { $n.vars['role'] == 'compiler' },
37+
}}
38+
'extra-large': {{
39+
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
40+
primary_postgresql_host => $t.filter |$n| { $n.vars['role'] == 'primary-pdb-postgresql' },
41+
compiler_hosts => $t.filter |$n| { $n.vars['role'] == 'compiler' },
42+
}}
43+
'extra-large-with-dr': {{
44+
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
45+
primary_postgresql_host => $t.filter |$n| { $n.vars['role'] == 'primary-pdb-postgresql' },
46+
replica_host => $t.filter |$n| { $n.vars['role'] == 'replica' },
47+
replica_postgresql_host => $t.filter |$n| { $n.vars['role'] == 'replica-pdb-postgresql' },
48+
compiler_hosts => $t.filter |$n| { $n.vars['role'] == 'compiler' },
49+
}}
50+
default: { fail('Invalid architecture!') }
51+
}
52+
53+
$params = $arch_params + $common_params
2654
run_plan('peadm::upgrade', $params)
2755
}

0 commit comments

Comments
 (0)