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

31 lines
778B

  1. # frozen_string_literal: true
  2. # Overide by OS
  3. keyfile = 'keyfile '
  4. driftfile = '/var/lib/chrony/'
  5. logdir = 'logdir /var/log/chrony'
  6. case os[:name]
  7. when 'debian', 'ubuntu'
  8. config_file = '/etc/chrony/chrony.conf'
  9. keyfile += '/etc/chrony/chrony.keys'
  10. driftfile += 'chrony.drift'
  11. else
  12. config_file = '/etc/chrony.conf'
  13. keyfile += '/etc/chrony.keys'
  14. driftfile += 'drift'
  15. end
  16. control 'Chrony configuration' do
  17. title 'should match desired lines'
  18. describe file(config_file) do
  19. it { should be_file }
  20. it { should be_owned_by 'root' }
  21. it { should be_grouped_into 'root' }
  22. its('mode') { should cmp '0644' }
  23. its('content') { should include keyfile }
  24. its('content') { should include driftfile }
  25. its('content') { should include logdir }
  26. end
  27. end