|
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 | +# @param replica_host |
| 12 | +# Optional new server that will become the PE replica server |
| 13 | +# @param primary_postgresql_host |
| 14 | +# Optional new server that will become the primary postgresql server |
11 | 15 | # |
12 | 16 | plan peadm::migrate ( |
13 | 17 | Peadm::SingleTargetSpec $old_primary_host, |
14 | 18 | Peadm::SingleTargetSpec $new_primary_host, |
15 | 19 | Optional[String] $upgrade_version = undef, |
16 | 20 | Optional[Peadm::SingleTargetSpec] $replica_host = undef, |
| 21 | + Optional[Peadm::SingleTargetSpec] $primary_postgresql_host = undef, |
17 | 22 | ) { |
18 | 23 | # pre-migration checks |
19 | 24 | 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 | 30 |
|
26 | 31 | $new_hosts = peadm::flatten_compact([ |
27 | 32 | $new_primary_host, |
28 | | - $replica_host ? { undef => [], default => [$replica_host] } |
| 33 | + $replica_host ? { undef => [], default => [$replica_host] }, |
| 34 | + $primary_postgresql_host ? { undef => [], default => [$primary_postgresql_host] } |
29 | 35 | ].flatten) |
30 | 36 | $all_hosts = peadm::flatten_compact([ |
31 | 37 | $old_primary_host, |
|
117 | 123 | out::message('No nodes to purge from old configuration') |
118 | 124 | } |
119 | 125 |
|
| 126 | + if $primary_postgresql_host { |
| 127 | + run_plan('peadm::add_database', targets => $primary_postgresql_host, |
| 128 | + primary_host => $new_primary_host, |
| 129 | + is_migration => true, |
| 130 | + ) |
| 131 | + } |
| 132 | + |
120 | 133 | if $replica_host { |
121 | 134 | run_plan('peadm::add_replica', { |
122 | 135 | primary_host => $new_primary_host, |
|
0 commit comments