Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
architecture:
- standard
- standard-with-dr
# - large
- large
# - extra-large
# - large-with-dr
- large-with-dr
# - extra-large-with-dr
version: [2021.7.9, 2023.8.2, 2025.1.0]
image: [almalinux-cloud/almalinux-8]
Expand Down
11 changes: 10 additions & 1 deletion plans/add_replica.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
$peadm_config['params']['replica_host'],
]).unique

out::message("Replicas:${replicas}.")
out::message("replica_host:${replica_host}.")
out::message("peadm_config['params']['replica_host']:${peadm_config['params']['replica_host']}.")

$certdata = run_task('peadm::cert_data', $primary_target).first.value
$primary_avail_group_letter = $certdata['extensions'][peadm::oid('peadm_availability_group')]
$replica_avail_group_letter = $primary_avail_group_letter ? { 'A' => 'B', 'B' => 'A' }
Expand Down Expand Up @@ -114,6 +118,11 @@
)
}

out::message("primary_target:${primary_target}.")
out::message("replica_target:${replica_target}.")
out::message("replica_target.peadm::certname():${replica_target.peadm::certname()}.")
out::message("token_file:${token_file}.")

# Provision the new system as a replica
run_task('peadm::provision_replica', $primary_target,
replica => $replica_target.peadm::certname(),
Expand All @@ -123,7 +132,7 @@
# probably gets "starting", but fails out because that's not "running".
# Can remove flag when that issue is fixed.
legacy => false,
# _catch_errors => true, # testing
_catch_errors => true, # testing
)

# start puppet service
Expand Down
4 changes: 2 additions & 2 deletions tasks/provision_replica.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ set -e
if [ "$PT_legacy" = "false" ]; then
echo "(legacy=false) query active nodes before provision replica"
puppet query '["from","resources",["extract",["certname"],["and",["=","type","Class"],["=","title","Puppet_enterprise::Profile::Master"]]]]'

echo "(legacy=false) provision replica $PT_replica and token file $TOKEN_FILE"
puppet infrastructure provision replica "$PT_replica" \
--color false \
--yes --token-file "$TOKEN_FILE" \
--skip-agent-config \
--topology mono-with-compile \
--enable

echo "(legacy=false) provisioned replica"
elif [ "$PT_legacy" = "true" ]; then
echo "(legacy=true) query active nodes before provision replica"
puppet query '["from","resources",["extract",["certname"],["and",["=","type","Class"],["=","title","Puppet_enterprise::Profile::Master"]]]]'
Expand Down
Loading