Saltstack Official Apache Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

46 lines
1.1KB

  1. # frozen_string_literal: true
  2. control 'apache server_status configuration' do
  3. title 'should match desired lines'
  4. server_status_stanza = <<~SS_STANZA
  5. <Location "/server-status">
  6. SetHandler server-status
  7. Require local
  8. Require host foo.example.com
  9. Require ip 10.8.8.0/24
  10. </Location>
  11. SS_STANZA
  12. confdir =
  13. case system.platform[:family]
  14. when 'debian'
  15. '/etc/apache2/conf-available'
  16. when 'redhat', 'fedora'
  17. '/etc/httpd/conf.d'
  18. when 'suse'
  19. '/etc/apache2/conf.d'
  20. when 'arch'
  21. '/etc/httpd/conf/extra'
  22. when 'bsd'
  23. '/usr/local/etc/apache24/extra'
  24. end
  25. conffile, conffile_group =
  26. case system.platform[:family]
  27. when 'bsd'
  28. %W[#{confdir}/server-status wheel]
  29. else
  30. %W[#{confdir}/server-status.conf root]
  31. end
  32. describe file(conffile) do
  33. it { should be_file }
  34. it { should be_owned_by 'root' }
  35. it { should be_grouped_into conffile_group }
  36. its('mode') { should cmp '0644' }
  37. its('content') { should include '# File managed by Salt' }
  38. its('content') { should include server_status_stanza }
  39. end
  40. end