|
8 | 8 | # The new server that will become the PE primary server |
9 | 9 | # @param upgrade_version |
10 | 10 | # Optional version to upgrade to after migration is complete |
11 | | -# |
| 11 | +# @param replica_host |
| 12 | +# Optional new replica server to be added to the cluster |
| 13 | +# @param primary_postgresql_host |
| 14 | +# Optional new primary PostgreSQL server to be added to the cluster |
| 15 | +# @param replica_postgresql_host |
| 16 | +# Optional new replica PostgreSQL server to be added to the cluster |
12 | 17 | plan peadm::migrate ( |
13 | 18 | Peadm::SingleTargetSpec $old_primary_host, |
14 | 19 | Peadm::SingleTargetSpec $new_primary_host, |
15 | 20 | Optional[String] $upgrade_version = undef, |
16 | 21 | Optional[Peadm::SingleTargetSpec] $replica_host = undef, |
| 22 | + Optional[Peadm::SingleTargetSpec] $primary_postgresql_host = undef, |
| 23 | + Optional[Peadm::SingleTargetSpec] $replica_postgresql_host = undef, |
17 | 24 | ) { |
18 | 25 | # pre-migration checks |
19 | 26 | out::message('This plan is a work in progress and it is not recommended to be used until it is fully implemented and supported') |
|
25 | 32 |
|
26 | 33 | $new_hosts = peadm::flatten_compact([ |
27 | 34 | $new_primary_host, |
28 | | - $replica_host ? { undef => [], default => [$replica_host] } |
| 35 | + $replica_host ? { undef => [], default => [$replica_host] }, |
| 36 | + $primary_postgresql_host ? { undef => [], default => [$primary_postgresql_host] }, |
| 37 | + $replica_postgresql_host ? { undef => [], default => [$replica_postgresql_host] }, |
29 | 38 | ].flatten) |
30 | 39 | $all_hosts = peadm::flatten_compact([ |
31 | 40 | $old_primary_host, |
|
118 | 127 | out::message('No nodes to purge from old configuration') |
119 | 128 | } |
120 | 129 |
|
| 130 | + if $primary_postgresql_host { |
| 131 | + run_plan('peadm::add_database', targets => $primary_postgresql_host, |
| 132 | + primary_host => $new_primary_host, |
| 133 | + ) |
| 134 | + if $replica_postgresql_host { |
| 135 | + run_plan('peadm::add_database', targets => $replica_postgresql_host, |
| 136 | + primary_host => $new_primary_host, |
| 137 | + ) |
| 138 | + } |
| 139 | + } |
| 140 | + |
121 | 141 | if $replica_host { |
122 | 142 | run_plan('peadm::add_replica', { |
123 | 143 | primary_host => $new_primary_host, |
|
0 commit comments