Saltstack Official PHP Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
902B

  1. control 'Php service' do
  2. title 'should be running and enabled'
  3. def test_debian
  4. describe service('php5.6-fpm') do
  5. it { should be_enabled }
  6. it { should be_running }
  7. end
  8. describe service('php7.3-fpm') do
  9. it { should be_enabled }
  10. it { should be_running }
  11. end
  12. end
  13. def test_ubuntu
  14. describe service(pkg_name) do
  15. it { should be_enabled }
  16. it { should be_running }
  17. end
  18. end
  19. def test_redhat
  20. describe service('php') do
  21. it { should be_enabled }
  22. it { should be_running }
  23. end
  24. end
  25. def test_suse
  26. describe service('php5') do
  27. it { should be_enabled }
  28. it { should be_running }
  29. end
  30. end
  31. case os[:family]
  32. when 'debian'
  33. case os[:name]
  34. when 'ubuntu'
  35. test_ubuntu
  36. when 'debian'
  37. test_debian
  38. end
  39. when 'redhat', 'fedora'
  40. test_redhat
  41. when 'suse'
  42. test_suse
  43. end
  44. end