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.

60 lines
1.0KB

  1. control 'Php package' do
  2. title 'should be installed'
  3. def test_debian
  4. describe package('php-imagick') do
  5. it { should be_installed }
  6. end
  7. describe package('php-redis') do
  8. it { should be_installed }
  9. end
  10. %w[
  11. bz2 cli curl fpm gd imap intl mbstring
  12. mysql readline xml zip
  13. ].each do |pkg|
  14. describe package("php5.6-#{pkg}") do
  15. it { should be_installed }
  16. end
  17. describe package("php7.3-#{pkg}") do
  18. it { should be_installed }
  19. end
  20. end
  21. end
  22. def test_ubuntu
  23. describe package(pkg_name) do
  24. it { should be_installed }
  25. end
  26. end
  27. def test_redhat
  28. describe package('php') do
  29. it { should be_installed }
  30. end
  31. end
  32. def test_suse
  33. describe package('php5') do
  34. it { should be_installed }
  35. end
  36. end
  37. case os[:family]
  38. when 'debian'
  39. case os[:name]
  40. when 'ubuntu'
  41. test_ubuntu
  42. when 'debian'
  43. test_debian
  44. end
  45. when 'redhat', 'fedora'
  46. test_redhat
  47. when 'suse'
  48. test_suse
  49. end
  50. end