Skip to content

Commit 509e6e4

Browse files
committed
add primary_postgresql_host as an optional parameter in the migration plan. add it as a parameter, convert the string to a target, and add it as a step running the migration in the test_migration workflow .pp
1 parent eea87f4 commit 509e6e4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

plans/migrate.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Peadm::SingleTargetSpec $new_primary_host,
1515
Optional[String] $upgrade_version = undef,
1616
Optional[Peadm::SingleTargetSpec] $replica_host = undef,
17+
Optional[Peadm::SingleTargetSpec] $primary_postgresql_host = undef,
1718
) {
1819
# pre-migration checks
1920
out::message('This plan is a work in progress and it is not recommended to be used until it is fully implemented and supported')

spec/acceptance/peadm_spec/plans/test_migration.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
String $primary_host,
33
String $new_primary_host,
44
Optional[String] $new_replica_host = undef,
5+
Optional[String] $primary_postgresql_host = undef,
56
Optional[String] $new_primary_postgresql_host = undef,
67
Optional[String] $new_replica_postgresql_host = undef,
78
Optional[String] $upgrade_version = undef,
@@ -10,6 +11,7 @@
1011
$primary_target = $primary_host ? { '' => undef, default => peadm::get_targets($primary_host, 1) }
1112
$new_primary_target = $new_primary_host ? { '' => undef, default => peadm::get_targets($new_primary_host, 1) }
1213
$new_replica_target = $new_replica_host ? { '' => undef, default => peadm::get_targets($new_replica_host, 1) }
14+
$primary_postgresql_target = $primary_postgresql_host ? { '' => undef, default => peadm::get_targets($primary_postgresql_host, 1) }
1315
$new_primary_postgresql_target = $new_primary_postgresql_host ? { '' => undef, default => peadm::get_targets($new_primary_postgresql_host, 1) }
1416
$new_replica_postgresql_target = $new_replica_postgresql_host ? { '' => undef, default => peadm::get_targets($new_replica_postgresql_host, 1) }
1517

@@ -30,6 +32,8 @@
3032
new_primary_host => $new_primary_target,
3133
upgrade_version => $upgrade_version,
3234
replica_host => $new_replica_target,
35+
primary_postgresql_host => $primary_postgresql_target,
36+
new_primary_postgresql_host => $new_primary_postgresql_target,
3337
)
3438

3539
# run infra status on the new primary

0 commit comments

Comments
 (0)