Skip to content

Commit

Permalink
#279 leave stubs for many rhel family conf.d files to avoid conflicts…
Browse files Browse the repository at this point in the history
… on package upgrades
  • Loading branch information
svanzoest committed Nov 7, 2016
1 parent 7b36e4d commit fb10804
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 47 deletions.
3 changes: 1 addition & 2 deletions recipes/mod_apreq2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
end

file "#{node['apache']['dir']}/conf.d/apreq.conf" do
action :delete
backup false
content '# conf is under mods-available/apreq.conf - apache2 cookbook\n'
end

apache_module 'apreq'
3 changes: 1 addition & 2 deletions recipes/mod_auth_cas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
end

file "#{node['apache']['dir']}/conf.d/auth_cas.conf" do
action :delete
backup false
content '# conf is under mods-available/auth_cas.conf - apache2 cookbook\n'
end
end
end
Expand Down
3 changes: 1 addition & 2 deletions recipes/mod_fcgid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
end

file "#{node['apache']['dir']}/conf.d/fcgid.conf" do
action :delete
backup false
content '# conf is under mods-available/fcgid.conf - apache2 cookbook\n'
end

directory '/var/run/httpd/mod_fcgid' do
Expand Down
3 changes: 1 addition & 2 deletions recipes/mod_perl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
end

file "#{node['apache']['dir']}/conf.d/perl.conf" do
action :delete
backup false
content '# conf is under mods-available/perl.conf - apache2 cookbook\n'
end

apache_module 'perl'
26 changes: 13 additions & 13 deletions recipes/mod_php.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@
end
end unless node['apache']['mod_php']['install_method'] == 'source'

# on debian plaform_family php creates newly named incompatible config
file "#{node['apache']['dir']}/mods-enabled/php7.0.conf" do
action :delete
backup false
end

file "#{node['apache']['dir']}/mods-enabled/php7.0.load" do
action :delete
backup false
end
case node['platform_family'] # rubocop:disable Style/MultilineIfModifier
when 'debian'
# on debian plaform_family php creates newly named incompatible config
file "#{node['apache']['dir']}/mods-available/php7.0.conf" do
content '# conf is under mods-available/php.conf - apache2 cookbook\n'
end

file "#{node['apache']['dir']}/conf.d/php.conf" do
action :delete
backup false
file "#{node['apache']['dir']}/mods-available/php7.0.load" do
content '# conf is under mods-available/php.load - apache2 cookbook\n'
end
when 'rhel', 'fedora', 'suse'
file "#{node['apache']['dir']}/conf.d/php.conf" do
content '# conf is under mods-available/php.conf - apache2 cookbook\n'
end
end

template "#{node['apache']['dir']}/mods-available/php.conf" do
Expand Down
3 changes: 1 addition & 2 deletions recipes/mod_python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
end

file "#{node['apache']['dir']}/conf.d/python.conf" do
action :delete
backup false
content '# conf is under mods-available/python.conf - apache2 cookbook\n'
end

apache_module 'python'
5 changes: 3 additions & 2 deletions recipes/mod_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
not_if { platform_family?('suse') }
end

r = resources(:file => "#{node['apache']['dir']}/conf.d/ssl.conf")
r.content "# SSL Conf is under mods-enabled/ssl.conf\n"
file "#{node['apache']['dir']}/conf.d/ssl.conf" do
content '# SSL Conf is under mods-available/ssl.conf - apache2 cookbook\n'
end
end

template 'ssl_ports.conf' do
Expand Down
3 changes: 1 addition & 2 deletions recipes/mod_wsgi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
end

file "#{node['apache']['dir']}/conf.d/wsgi.conf" do
action :delete
backup false
content '# conf is under mods-available/wsgi.conf - apache2 cookbook\n'
end

apache_module 'wsgi'
3 changes: 1 addition & 2 deletions recipes/mod_xsendfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
end

file "#{node['apache']['dir']}/conf.d/xsendfile.conf" do
action :delete
backup false
content '# conf is under mods-available/xsendfile.conf - apache2 cookbook\n'
end

apache_module 'xsendfile'
6 changes: 3 additions & 3 deletions spec/modules/mod_apreq2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
end
end

it "deletes #{property[:apache][:dir]}/conf.d/apreq.conf" do
expect(chef_run).to delete_file("#{property[:apache][:dir]}/conf.d/apreq.conf").with(:backup => false)
expect(chef_run).to_not delete_file("#{property[:apache][:dir]}/conf.d/apreq.conf").with(:backup => true)
it "stubs #{property[:apache][:dir]}/conf.d/apreq.conf" do
expect(chef_run).to create_file("#{property[:apache][:dir]}/conf.d/apreq.conf")
.with(:content => '# conf is under mods-available/apreq.conf - apache2 cookbook\n')
end
it_should_behave_like 'an apache2 module', 'apreq', false
end
Expand Down
6 changes: 3 additions & 3 deletions spec/modules/mod_perl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
end
end

it "deletes #{property[:apache][:dir]}/conf.d/perl.conf" do
expect(chef_run).to delete_file("#{property[:apache][:dir]}/conf.d/perl.conf").with(:backup => false)
expect(chef_run).to_not delete_file("#{property[:apache][:dir]}/conf.d/perl.conf").with(:backup => true)
it "stubs #{property[:apache][:dir]}/conf.d/perl.conf" do
expect(chef_run).to create_file("#{property[:apache][:dir]}/conf.d/perl.conf")
.with(:content => '# conf is under mods-available/perl.conf - apache2 cookbook\n')
end
it_should_behave_like 'an apache2 module', 'perl', false
end
Expand Down
8 changes: 5 additions & 3 deletions spec/modules/mod_php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
end
end

it 'deletes [apache.dir]/conf.d/php.conf' do
expect(chef_run).to delete_file("#{property[:apache][:dir]}/conf.d/php.conf").with(:backup => false)
expect(chef_run).to_not delete_file("#{property[:apache][:dir]}/conf.d/php.conf").with(:backup => true)
if %w(redhat fedora suse opensuse).include?(platform)
it 'stubs [apache.dir]/conf.d/php.conf' do
expect(chef_run).to create_file("#{property[:apache][:dir]}/conf.d/php.conf")
.with(:content => '# conf is under mods-available/php.conf - apache2 cookbook\n')
end
end
it_behaves_like 'an apache2 module', property[:apache][:mod_php][:module_name], false, property[:apache][:mod_php][:so_filename]
end
Expand Down
6 changes: 3 additions & 3 deletions spec/modules/mod_python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
end
end

it "deletes #{property[:apache][:dir]}/conf.d/python.conf" do
expect(chef_run).to delete_file("#{property[:apache][:dir]}/conf.d/python.conf").with(:backup => false)
expect(chef_run).to_not delete_file("#{property[:apache][:dir]}/conf.d/python.conf").with(:backup => true)
it "stubs #{property[:apache][:dir]}/conf.d/python.conf" do
expect(chef_run).to create_file("#{property[:apache][:dir]}/conf.d/python.conf")
.with(:content => '# conf is under mods-available/python.conf - apache2 cookbook\n')
end
it_should_behave_like 'an apache2 module', 'python', false
end
Expand Down
6 changes: 3 additions & 3 deletions spec/modules/mod_ssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
expect(package).to notify('execute[generate-module-list]').to(:run)
expect(package).to_not notify('execute[generate-module-list]').to(:nothing)
end
it "deletes #{property[:apache][:dir]}/conf.d/ssl.conf" do
expect(chef_run).to delete_file("#{property[:apache][:dir]}/conf.d/ssl.conf").with(:backup => false)
expect(chef_run).to_not delete_file("#{property[:apache][:dir]}/conf.d/ssl.conf").with(:backup => true)
it "stubs #{property[:apache][:dir]}/conf.d/ssl.conf" do
expect(chef_run).to create_file("#{property[:apache][:dir]}/conf.d/ssl.conf")
.with(:content => '# SSL Conf is under mods-available/ssl.conf - apache2 cookbook\n')
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/modules/mod_xsendfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
end
end

it "deletes #{property[:apache][:dir]}/conf.d/xsendfile.conf" do
expect(chef_run).to delete_file("#{property[:apache][:dir]}/conf.d/xsendfile.conf").with(:backup => false)
expect(chef_run).to_not delete_file("#{property[:apache][:dir]}/conf.d/xsendfile.conf").with(:backup => true)
it "stubs #{property[:apache][:dir]}/conf.d/xsendfile.conf" do
expect(chef_run).to create_file("#{property[:apache][:dir]}/conf.d/xsendfile.conf")
.with(:content => '# conf is under mods-available/xsendfile.conf - apache2 cookbook\n')
end
it_should_behave_like 'an apache2 module', 'xsendfile', false
end
Expand Down

0 comments on commit fb10804

Please sign in to comment.