File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed
Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 7979 internal_compiler_b_pool_address => $replica_avail_group_letter ? { ' B' => $replica_host , default => undef }
8080 )
8181
82+ # Source the global hiera.yaml from Primary and synchronize to new Replica
83+ # Provision the new system as a replica
84+ run_plan(' peadm::util::sync_global_hiera' , $replica_target ,
85+ primary_host => $primary_target
86+ )
87+
8288 # Provision the new system as a replica
8389 run_task(' peadm::provision_replica' , $primary_target ,
8490 replica => $replica_target .peadm::certname(),
Original file line number Diff line number Diff line change 1+ # @api private
2+ plan peadm::util::sync_global_hiera (
3+ Peadm::SingleTargetSpec $targets ,
4+ Peadm::SingleTargetSpec $primary_host ,
5+ ) {
6+
7+ $primary_target = peadm::get_targets($primary_host , 1)
8+ $replica_target = $targets
9+
10+ # Source the global hiera.yaml from Primary and synchronize to new Replica
11+ $global_hiera_yaml = run_task(' peadm::read_file' , $primary_target ,
12+ path => ' /etc/puppetlabs/puppet/hiera.yaml' ,
13+ ).first[' content' ]
14+
15+ run_task(' peadm::mkdir_p_file' , $replica_target ,
16+ path => ' /etc/puppetlabs/puppet/hiera.yaml' ,
17+ owner => ' root' ,
18+ group => ' root' ,
19+ mode => ' 0644' ,
20+ content => $global_hiera_yaml ,
21+ )
22+ }
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def allow_standard_non_returning_calls
1717 it 'runs successfully when the primary does not have alt-names' do
1818 allow_standard_non_returning_calls
1919 expect_task ( 'peadm::get_peadm_config' ) . always_return ( cfg )
20- expect_task ( 'peadm::cert_data' ) . always_return ( certdata ) . be_called_times ( 3 )
20+ expect_task ( 'peadm::cert_data' ) . always_return ( certdata ) . be_called_times ( 4 )
2121 expect_task ( 'package' ) . always_return ( { 'status' => 'uninstalled' } )
2222 expect_task ( 'peadm::agent_install' )
2323 . with_params ( { 'server' => 'primary' ,
@@ -35,7 +35,7 @@ def allow_standard_non_returning_calls
3535 it 'runs successfully when the primary has alt-names' do
3636 allow_standard_non_returning_calls
3737 expect_task ( 'peadm::get_peadm_config' ) . always_return ( cfg )
38- expect_task ( 'peadm::cert_data' ) . always_return ( certdata . merge ( { 'dns-alt-names' => [ 'primary' , 'alt' ] } ) ) . be_called_times ( 3 )
38+ expect_task ( 'peadm::cert_data' ) . always_return ( certdata . merge ( { 'dns-alt-names' => [ 'primary' , 'alt' ] } ) ) . be_called_times ( 4 )
3939 expect_task ( 'package' ) . always_return ( { 'status' => 'uninstalled' } )
4040 expect_task ( 'peadm::agent_install' )
4141 . with_params ( { 'server' => 'primary' ,
You can’t perform that action at this time.
0 commit comments