Skip to content

Commit ddef526

Browse files
(PE-40386) assign 'A' to avail_group_letter if this is a migration
1 parent 5653630 commit ddef526

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

plans/add_database.pp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,17 @@
6161
out::message("Operating in ${operating_mode} mode")
6262

6363
if $operating_mode == 'init' {
64-
# If no other PSQL node then match primary group letter
65-
$avail_group_letter = peadm::flatten_compact($roles['server'].map |$k,$v| {
66-
if $v == $primary_host {
67-
$k
68-
}
69-
})[0]
64+
# if we are doing a migration then we need to assign the new node to group A
65+
if $is_migration {
66+
$avail_group_letter = 'A'
67+
} else {
68+
# If no other PSQL node then match primary group letter
69+
$avail_group_letter = peadm::flatten_compact($roles['server'].map |$k,$v| {
70+
if $v == $primary_host {
71+
$k
72+
}
73+
})[0]
74+
}
7075
# Assume PuppetDB backend hosted on Primary if in init mode
7176
$source_db_host = $primary_host
7277
} else {

0 commit comments

Comments
 (0)