|
1 | 1 | plan peadm_spec::upgrade_test_cluster( |
| 2 | + $architecture, |
2 | 3 | $version, |
3 | 4 | $download_mode |
4 | 5 | ){ |
|
11 | 12 | $target.set_var('certname', $fqdn.first['stdout'].chomp) |
12 | 13 | } |
13 | 14 |
|
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, |
24 | 18 | } |
25 | 19 |
|
| 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 |
26 | 54 | run_plan('peadm::upgrade', $params) |
27 | 55 | } |
0 commit comments