|
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') |
|
26 | 31 | $all_hosts = peadm::flatten_compact([ |
27 | 32 | $old_primary_host, |
28 | 33 | $new_primary_host, |
29 | | - $replica_host ? { undef => [], default => [$replica_host] } |
| 34 | + $replica_host ? { undef => [], default => [$replica_host] }, |
| 35 | + $primary_postgresql_host ? { undef => [], default => [$primary_postgresql_host] } |
30 | 36 | ].flatten) |
31 | 37 | run_command('hostname', $all_hosts) # verify can connect to targets |
32 | 38 |
|
|
114 | 120 | out::message('No nodes to purge from old configuration') |
115 | 121 | } |
116 | 122 |
|
| 123 | + if $primary_postgresql_host { |
| 124 | + run_plan('peadm::add_database', targets => $primary_postgresql_host, |
| 125 | + primary_host => $new_primary_host, |
| 126 | + is_migration => true, |
| 127 | + ) |
| 128 | + } |
| 129 | + |
117 | 130 | if $replica_host { |
118 | 131 | run_plan('peadm::add_replica', { |
119 | 132 | primary_host => $new_primary_host, |
|
0 commit comments