Saltstack Official Nginx 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.

38 lines
1.1KB

  1. # frozen_string_literal: true
  2. case platform.family
  3. when 'redhat'
  4. repo_file = '/etc/yum.repos.d/passenger.repo'
  5. repo_url = 'https://oss-binaries.phusionpassenger.com/yum/passenger/el/$releasever/$basearch'
  6. when 'debian'
  7. codename = system.platform[:codename]
  8. repo_keyring = '/usr/share/keyrings/phusionpassenger-archive-keyring.gpg'
  9. repo_file = "/etc/apt/sources.list.d/phusionpassenger-official-#{codename}.list"
  10. # rubocop:disable Layout/LineLength
  11. repo_url = "deb [signed-by=#{repo_keyring}] https://oss-binaries.phusionpassenger.com/apt/passenger #{codename} main"
  12. # rubocop:enable Layout/LineLength
  13. end
  14. control 'Phusion-passenger repository keyring' do
  15. title 'should be installed'
  16. only_if('Requirement for Debian family') do
  17. os.debian?
  18. end
  19. describe file(repo_keyring) do
  20. it { should exist }
  21. it { should be_owned_by 'root' }
  22. it { should be_grouped_into 'root' }
  23. its('mode') { should cmp '0644' }
  24. end
  25. end
  26. control 'Phusion-passenger repository' do
  27. impact 1
  28. title 'should be configured'
  29. describe file(repo_file) do
  30. its('content') { should include repo_url }
  31. end
  32. end