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.

29 lines
747B

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