File tree 3 files changed +30
-2
lines changed
3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 79
79
internal_compiler_b_pool_address => $replica_avail_group_letter ? { ' B' => $replica_host , default => undef }
80
80
)
81
81
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
+
82
88
# Provision the new system as a replica
83
89
run_task(' peadm::provision_replica' , $primary_target ,
84
90
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
17
17
it 'runs successfully when the primary does not have alt-names' do
18
18
allow_standard_non_returning_calls
19
19
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 )
21
21
expect_task ( 'package' ) . always_return ( { 'status' => 'uninstalled' } )
22
22
expect_task ( 'peadm::agent_install' )
23
23
. with_params ( { 'server' => 'primary' ,
@@ -35,7 +35,7 @@ def allow_standard_non_returning_calls
35
35
it 'runs successfully when the primary has alt-names' do
36
36
allow_standard_non_returning_calls
37
37
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 )
39
39
expect_task ( 'package' ) . always_return ( { 'status' => 'uninstalled' } )
40
40
expect_task ( 'peadm::agent_install' )
41
41
. with_params ( { 'server' => 'primary' ,
You can’t perform that action at this time.
0 commit comments