File tree 3 files changed +23
-2
lines changed
3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 327
327
ensure => file ,
328
328
content => template ($conf_template ),
329
329
notify => Class[' Apache::Service' ],
330
- require => Package[' httpd' ],
330
+ require => [ Package[' httpd' ], File [ $ports_file ] ],
331
331
}
332
332
333
333
# preserve back-wards compatibility to the times when default_mods was
Original file line number Diff line number Diff line change @@ -52,4 +52,25 @@ class { 'apache': }
52
52
it { is_expected . to be_file }
53
53
end
54
54
end
55
+
56
+ describe 'custom_config only applied after configs are written' do
57
+ it 'applies in the right order' do
58
+ pp = <<-EOS
59
+ class { 'apache': }
60
+
61
+ apache::custom_config { 'ordering_test':
62
+ content => '# just a comment',
63
+ }
64
+
65
+ # Try to wedge the apache::custom_config call between when httpd.conf is written and
66
+ # ports.conf is written. This should trigger a dependency cycle
67
+ File["#{ $conf_file} "] -> Apache::Custom_config['ordering_test'] -> File["#{ $ports_file} "]
68
+ EOS
69
+ expect ( apply_manifest ( pp , :expect_failures => true ) . stderr ) . to match ( /Failed to apply catalog: Found 1 dependency cycle/i )
70
+ end
71
+
72
+ describe file ( "#{ $confd_dir} /25-ordering_test.conf" ) do
73
+ it { is_expected . not_to be_file }
74
+ end
75
+ end
55
76
end
Original file line number Diff line number Diff line change 480
480
it { is_expected . to contain_file ( "/opt/rh/root/etc/httpd/conf/httpd.conf" ) . with (
481
481
'ensure' => 'file' ,
482
482
'notify' => 'Class[Apache::Service]' ,
483
- 'require' => 'Package[httpd]'
483
+ 'require' => [ 'Package[httpd]' , 'File[/etc/httpd/conf/ports.conf]' ] ,
484
484
) }
485
485
end
486
486
You can’t perform that action at this time.
0 commit comments